UNPKG

3.71 kBTypeScriptView Raw
1import { Account, AccountKey, AccountUnclaimed, AccountUnclaimedKey, AccountUnclaimedsKey, AccountUnspent, AccountUnspentKey, AccountUnspentsKey, AccountUpdate, Action, ActionKey, ActionsKey, Asset, AssetKey, AssetUpdate, Block, BlockchainStorage, BlockData, BlockDataKey, ChangeSet, Contract, ContractKey, Header, InvocationData, InvocationDataKey, StorageItem, StorageItemKey, StorageItemsKey, StorageItemUpdate, Transaction, TransactionData, TransactionDataKey, TransactionDataUpdate, TransactionKey, Validator, ValidatorKey, ValidatorsCount, ValidatorsCountUpdate, ValidatorUpdate, VM, WriteBlockchain } from '@neo-one/node-core';
2import { BlockLikeStorageCache, OutputStorageCache, ReadAddDeleteStorageCache, ReadAddStorageCache, ReadAddUpdateMetadataStorageCache, ReadAddUpdateStorageCache, ReadAllAddUpdateDeleteStorageCache, ReadGetAllAddDeleteStorageCache, ReadGetAllAddStorageCache, ReadGetAllAddUpdateDeleteStorageCache, TrackedChangeSet } from './StorageCache';
3interface WriteBatchBlockchainOptions {
4 readonly settings: WriteBlockchain['settings'];
5 readonly currentBlock: WriteBlockchain['currentBlock'] | undefined;
6 readonly currentHeader: WriteBlockchain['currentHeader'] | undefined;
7 readonly storage: BlockchainStorage;
8 readonly vm: VM;
9 readonly getValidators: WriteBlockchain['getValidators'];
10}
11export declare class WriteBatchBlockchain {
12 readonly settings: WriteBlockchain['settings'];
13 readonly account: ReadAllAddUpdateDeleteStorageCache<AccountKey, Account, AccountUpdate>;
14 readonly accountUnspent: ReadGetAllAddDeleteStorageCache<AccountUnspentKey, AccountUnspentsKey, AccountUnspent>;
15 readonly accountUnclaimed: ReadGetAllAddDeleteStorageCache<AccountUnclaimedKey, AccountUnclaimedsKey, AccountUnclaimed>;
16 readonly action: ReadGetAllAddStorageCache<ActionKey, ActionsKey, Action>;
17 readonly asset: ReadAddUpdateStorageCache<AssetKey, Asset, AssetUpdate>;
18 readonly block: BlockLikeStorageCache<Block>;
19 readonly blockData: ReadAddStorageCache<BlockDataKey, BlockData>;
20 readonly header: BlockLikeStorageCache<Header>;
21 readonly transaction: ReadAddStorageCache<TransactionKey, Transaction>;
22 readonly transactionData: ReadAddUpdateStorageCache<TransactionDataKey, TransactionData, TransactionDataUpdate>;
23 readonly output: OutputStorageCache;
24 readonly contract: ReadAddDeleteStorageCache<ContractKey, Contract>;
25 readonly storageItem: ReadGetAllAddUpdateDeleteStorageCache<StorageItemKey, StorageItemsKey, StorageItem, StorageItemUpdate>;
26 readonly validator: ReadAllAddUpdateDeleteStorageCache<ValidatorKey, Validator, ValidatorUpdate>;
27 readonly invocationData: ReadAddStorageCache<InvocationDataKey, InvocationData>;
28 readonly validatorsCount: ReadAddUpdateMetadataStorageCache<ValidatorsCount, ValidatorsCountUpdate>;
29 readonly getValidators: WriteBlockchain['getValidators'];
30 private readonly currentBlockInternal;
31 private readonly currentHeaderInternal;
32 private readonly storage;
33 private readonly vm;
34 private readonly caches;
35 constructor(options: WriteBatchBlockchainOptions);
36 readonly currentBlock: Block;
37 readonly currentBlockIndex: number;
38 readonly currentHeader: Header;
39 getChangeSet(): ChangeSet;
40 getTrackedChangeSet(): TrackedChangeSet<any, any, any>;
41 persistBlock(block: Block): Promise<void>;
42 private persistUTXOTransactions;
43 private persistTransactions;
44 private persistTransaction;
45 private processStateTransaction;
46 private updateAccounts;
47 private getOutputWithInput;
48 private getInputOutputs;
49 private groupByAddress;
50 private updateAccount;
51 private updateCoins;
52 private updateCoin;
53}
54export {};