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 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>>,
    pub disabled: AtomicBool,
}

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

Timestamp assigned to latest sealed block

Ancient block info.

First block info.

Traces to return

Pruning history size to report.

Is disabled

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.

Get block hash with delta as offset from the most recent blocks.

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

Inserts a transaction to miners transactions queue.

Set reported history size.

Returns true if the client has been disabled.

Trait Implementations

impl Default for TestBlockChainClient
[src]

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

impl ReopenBlock for TestBlockChainClient
[src]

Reopens an OpenBlock and updates uncles.

impl PrepareOpenBlock for TestBlockChainClient
[src]

Returns OpenBlock prepared for closing.

impl ScheduleInfo for TestBlockChainClient
[src]

Returns latest schedule.

impl ImportSealedBlock for TestBlockChainClient
[src]

Import sealed block. Skips all verifications.

impl BlockProducer for TestBlockChainClient
[src]

impl BroadcastProposalBlock for TestBlockChainClient
[src]

Broadcast a block proposal.

impl SealedBlockImporter for TestBlockChainClient
[src]

impl TransactionVerifierClient for TestBlockChainClient
[src]

impl BlockChainClient for TestBlockChainClient
[src]

impl Nonce for TestBlockChainClient
[src]

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

Get address nonce at the latest block's state.

impl Balance for TestBlockChainClient
[src]

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

Get address balance at the latest block's state.

impl AccountData for TestBlockChainClient
[src]

impl ChainInfo for TestBlockChainClient
[src]

Get blockchain information.

impl BlockInfo for TestBlockChainClient
[src]

Get raw block header data by block id.

Get the best block header.

Get raw block data by block header hash.

Get address code hash at given block's state.

impl CallContract for TestBlockChainClient
[src]

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

impl TransactionInfo for TestBlockChainClient
[src]

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

impl BlockChain for TestBlockChainClient
[src]

impl RegistryInfo for TestBlockChainClient
[src]

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

impl ImportBlock for TestBlockChainClient
[src]

Import a block into the blockchain.

impl Call for TestBlockChainClient
[src]

Type representing chain state

Makes a non-persistent transaction call.

Makes multiple non-persistent but dependent transaction calls. Returns a vector of successes or a failure if any of the transaction fails. Read more

Estimates how much gas will be necessary for a call.

impl StateClient for TestBlockChainClient
[src]

Type representing chain state

Get a copy of the best block's state.

Attempt to get a copy of a specific block's final state. Read more

impl EngineInfo for TestBlockChainClient
[src]

Get underlying engine object

impl BlockChainClient for TestBlockChainClient
[src]

Replays a given transaction for inspection.

Replays all the transactions in a given block for inspection.

Get block total difficulty.

Get block hash.

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

Get address code at given block's state.

Get address code hash at given 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 uncle with given id.

Returns engine-related extra info for UncleId.

Get transaction receipt with given hash.

Important traits for Vec<u8>

Returns logs matching given filter.

Get last hashes starting from best block.

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

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.

Get block queue information.

Clear block queue and abort all import activity.

Get the registrar address, if it exists.

Returns traces matching given filter.

Returns trace with given id.

Returns traces created by transaction.

Returns traces created by transaction from block.

Important traits for Vec<u8>

List all transactions that are allowed into the next block.

Get the preferred chain ID to sign on

Get the mode.

Set the mode.

Get the chain spec name.

Set the chain via a spec name.

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.

Schedule state-altering transaction to be executed on the next pending block.

Get the address of the registry itself.

Get the EIP-86 transition block number.

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.

impl IoClient for TestBlockChainClient
[src]

Queue transactions for importing.

Queue block import with transaction receipts. Does no sealing and transaction validation.

Queue conensus engine message.

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. Read more

Prove execution of a transaction at the given block. Returns the output of the call and a vector of database items necessary to reproduce it. Read more

Get an epoch change signal by block 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.

Get the transition to the epoch the given parent hash is part of or transitions to. This will give the epoch that any children of this parent belong to. Read more

Attempt to cast the engine client to a full client.

Get a block number by ID.

Get raw block header data by block id.

Auto Trait Implementations

impl Send for TestBlockChainClient

impl Sync for TestBlockChainClient