import { JsonRpcProvider } from 'ethers'; import { VmProxy } from './VmProxy'; import { VM } from '@ethereumjs/vm'; import { Common, CommonOpts } from '@ethereumjs/common'; import { MerklePatriciaTrie } from '@ethereumjs/mpt'; import { StateManagerInterface } from '@ethereumjs/common'; import { Block } from '@ethereumjs/block'; import { TypedTransaction } from '@ethereumjs/tx'; import { State } from './provider'; /** * Options for constructing a {@link StateManager}. */ export interface DefaultStateManagerOpts { /** * A {@link Trie} instance */ trie?: MerklePatriciaTrie; /** * Option to prefix codehashes in the database. This defaults to `true`. * If this is disabled, note that it is possible to corrupt the trie, by deploying code * which code is equal to the preimage of a trie-node. * E.g. by putting the code `0x80` into the empty trie, will lead to a corrupted trie. */ prefixCodeHashes?: boolean; } export interface CustomEthersStateManagerOpts { provider: string | JsonRpcProvider; blockTag: string; /** * A {@link Trie} instance */ trie?: MerklePatriciaTrie; } export type CurrentVm = { vm: VM; web3vm: VmProxy; stateManager: StateManagerInterface; common: Common; baseBlockNumber: string; }; export declare class VMCommon extends Common { constructor(opts: CommonOpts); /** * Always return the fork set at initialization */ setHardforkBy(): string; } export declare class VMContext { currentFork: string; blockGasLimitDefault: number; blockGasLimit: number; blocks: Record; blockByTxHash: Record; txByHash: Record; currentVm: CurrentVm; web3vm: VmProxy; logsManager: any; exeResults: Record; nodeUrl: string; latestBlockNumber: string; private blockNumber; baseBlockNumber: string; stateDb: State; rawBlocks: string[]; serializedBlocks: Uint8Array[]; constructor(fork?: string, nodeUrl?: string, blockNumber?: number | 'latest', stateDb?: State, blocksData?: string[], baseBlockNumber?: string); init(): Promise; createVm(hardfork: any): Promise<{ vm: VM; web3vm: VmProxy; stateManager: StateManagerInterface; common: VMCommon; blocks: Block[]; baseBlockNumber: string; }>; getCurrentFork(): string; web3(): VmProxy; vm(): VM; vmObject(): CurrentVm; addBlock(block: Block, genesis?: boolean, isCall?: boolean, web3vm?: VmProxy): void; trackTx(txHash: any, block: any, tx: any): void; trackExecResult(tx: any, execReult: any): void; }