Struct ethcore::client::TestBlockChainClient [] [src]

pub struct TestBlockChainClient {
    pub blocks: RwLock<HashMap<H256, Bytes>>,
    pub numbers: RwLock<HashMap<usize, H256>>,
    pub genesis_hash: H256,
    pub last_hash: RwLock<H256>,
    pub extra_data: Bytes,
    pub difficulty: RwLock<U256>,
    pub balances: RwLock<HashMap<Address, U256>>,
    pub nonces: RwLock<HashMap<Address, U256>>,
    pub storage: RwLock<HashMap<(Address, H256), H256>>,
    pub code: RwLock<HashMap<Address, Bytes>>,
    pub execution_result: RwLock<Option<Result<Executed, CallError>>>,
    pub receipts: RwLock<HashMap<TransactionId, LocalizedReceipt>>,
    pub logs: RwLock<Vec<LocalizedLogEntry>>,
    pub queue_size: AtomicUsize,
    pub miner: Arc<Miner>,
    pub spec: Spec,
    pub vm_factory: EvmFactory,
    pub latest_block_timestamp: RwLock<u64>,
    pub ancient_block: RwLock<Option<(H256, u64)>>,
    pub first_block: RwLock<Option<(H256, u64)>>,
    pub traces: RwLock<Option<Vec<LocalizedTrace>>>,
    pub history: RwLock<Option<u64>>,
}

Test client.

Fields

Blocks.

Mapping of numbers to hashes.

Genesis block hash.

Last block hash.

Extra data do set for each block

Difficulty.

Balances.

Nonces.

Storage.

Code.

Execution result.

Transaction receipts.

Logs

Block queue size.

Miner

Spec

VM Factory

Timestamp assigned to latest sealed block

Ancient block info.

First block info.

Traces to return

Pruning history size to report.

Methods

impl TestBlockChainClient
[src]

Creates new test client.

Creates new test client with specified extra data for each block

Create test client with custom spec.

Create test client with custom spec and extra data.

Set the transaction receipt result

Set the execution result.

Set the balance of account address to balance.

Set nonce of account address to nonce.

Set code at address.

Set storage position to value for account address.

Set block queue size for testing

Set timestamp assigned to latest sealed block

Set logs to return for each logs call.

Add blocks to test client.

Make a bad block by setting invalid extra data.

Make a bad block by setting invalid parent hash.

TODO:

Inserts a transaction with given gas price to miners transactions queue.

Inserts a transaction to miners transactions queue.

Set reported history size.

Trait Implementations

impl Default for TestBlockChainClient
[src]

Returns the "default value" for a type. Read more

impl MiningBlockChainClient for TestBlockChainClient
[src]

Returns latest schedule.

Returns OpenBlock prepared for closing.

Returns EvmFactory.

Import sealed block. Skips all verifications.

Broadcast a block proposal.

impl BlockChainClient for TestBlockChainClient
[src]

Makes a non-persistent transaction call.

Estimates how much gas will be necessary for a call.

Replays a given transaction for inspection.

Get block total difficulty.

Get block hash.

Attempt to get address nonce at given block. May not fail on BlockId::Latest. Read more

Attempt to get address storage root at given block. May not fail on BlockId::Latest. Read more

Get address nonce at the latest block's state.

Get address code at given block's state.

Get address balance at the given block's state. Read more

Get address balance at the latest block's state.

Get value of the storage at given position at the given block's state. Read more

Get a list of all accounts in the block id, if fat DB is in operation, otherwise None. If after is set the list starts with the following item. Read more

Get a list of all storage keys in the block id, if fat DB is in operation, otherwise None. If after is set the list starts with the following item. Read more

Get transaction with given hash.

Get the hash of block that contains the transaction, if any.

Get uncle with given id.

Returns engine-related extra info for UncleId.

Get transaction receipt with given hash.

Returns numbers of blocks containing given bloom.

Returns logs matching given filter.

Get last hashes starting from best block.

Get the best block header.

Get raw block header data by block id.

Look up the block number for the given block ID.

Get raw block body data by block id. Block body is an RLP list of two items: uncles and transactions. Read more

Get raw block data by block header hash.

Returns engine-related extra info for BlockId.

Get block status by block header hash.

Get a tree route between from and to. See BlockChain::tree_route. Read more

Get all possible uncle hashes for a block.

Get latest state node

Get raw block receipts data by block header hash.

Import a block into the blockchain.

Import a block with transaction receipts. Does no sealing and transaction validation.

Get block queue information.

Clear block queue and abort all import activity.

Get the registrar address, if it exists.

Get blockchain information.

Returns traces matching given filter.

Returns trace with given id.

Returns traces created by transaction.

Returns traces created by transaction from block.

Queue transactions for importing.

Queue conensus engine message.

List all transactions that are allowed into the next block.

Get the preferred network ID to sign on

Get the mode.

Set the mode.

Disable the client from importing blocks. This cannot be undone in this session and indicates that a subsystem has reason to believe this executable incapable of syncing the chain. Read more

Returns information about pruning/data availability.

Like call, but with various defaults. Designed to be used for calling contracts.

Import a transaction: used for misbehaviour reporting.

Get the address of the registry itself.

Get the address of a particular blockchain service, if available.

Should be called by any external-facing interface when actively using the client. To minimise chatter, there's no need to call more than once every 30s. Read more

Get address code at the latest block's state.

Get value of the storage at given position at the latest block's state.

Sorted list of transaction gas prices from at least last sample_size blocks.

Calculate median gas price from recent blocks if they have any transactions.

Get the gas price distribution based on recent blocks if they have any transactions.

impl ProvingBlockChainClient for TestBlockChainClient
[src]

Prove account storage at a specific block id. Read more

Prove account existence at a specific block id. The key is the keccak hash of the account's address. Returns a vector of raw trie nodes (in order from the root) proving the query. Nodes after from_level may be omitted. An empty vector indicates unservable query. Read more

Get code by address hash.

impl EngineClient for TestBlockChainClient
[src]

Make a new block and seal it.

Submit a seal for a block in the mining queue.

Broadcast a consensus message to the network.