UNPKG

deth

Version:

Ethereum node focused on Developer Experience

38 lines (37 loc) 2.05 kB
import { Address, Hash, Quantity, HexData } from './primitives'; import { Tag, RpcTransactionRequest, FilterRequest, RpcLogObject, RpcTransactionResponse, RpcBlockResponse, RpcTransactionReceipt, RpcRichBlockResponse } from './model'; import { TestChainOptions } from './TestChainOptions'; import { SnapshotObject } from './vm/storage/SnapshotObject'; import { DethLogger } from './debugger/Logger/DethLogger'; /** * TestChain wraps TestVM and provides an API suitable for use by a provider. * It is separate from the provider so that there can be many provider instances * using the same TestChain instance. */ export declare class TestChain { private logger; private tvm; options: SnapshotObject<TestChainOptions>; constructor(logger: DethLogger, options?: Partial<TestChainOptions>); init(): Promise<void>; makeSnapshot(): number; revertToSnapshot(id: number): void; skewClock(delta: number): void; startAutoMining(): void; stopAutoMining(): void; mineBlock(): Promise<void>; getBlockNumber(): Promise<Quantity>; getGasPrice(): Quantity; getBalance(address: Address, blockTag: Quantity | Tag): Promise<Quantity>; getTransactionCount(address: Address, blockTag: Quantity | Tag): Promise<Quantity>; getCode(address: Address, blockTag: Quantity | Tag): Promise<HexData>; getStorageAt(address: Address, position: Quantity, blockTag: Quantity | Tag): Promise<HexData>; sendTransaction(signedTransaction: HexData): Promise<Hash>; call(transactionRequest: RpcTransactionRequest, blockTag: Quantity | Tag): Promise<HexData>; estimateGas(transactionRequest: RpcTransactionRequest): Promise<Quantity>; getBlock(blockTagOrHash: Quantity | Tag | Hash, includeTransactions: boolean): Promise<RpcBlockResponse | RpcRichBlockResponse>; getTransaction(transactionHash: Hash): RpcTransactionResponse; getTransactionReceipt(transactionHash: Hash): RpcTransactionReceipt | undefined; getLogs(filter: FilterRequest): Promise<RpcLogObject[]>; private parseTx; }