Trait client_traits::BlockChainClient[][src]

pub trait BlockChainClient: Sync + Send + AccountData + BlockChain + CallContract + RegistrarClient + ImportBlock + IoClient + BadBlocks {
    fn block_number(&self, id: BlockId) -> Option<BlockNumber>;
fn block_body(&self, id: BlockId) -> Option<Body>;
fn block_status(&self, id: BlockId) -> BlockStatus;
fn block_total_difficulty(&self, id: BlockId) -> Option<U256>;
fn storage_root(&self, address: &Address, id: BlockId) -> Option<H256>;
fn block_hash(&self, id: BlockId) -> Option<H256>;
fn code(
        &self,
        address: &Address,
        state: StateOrBlock
    ) -> StateResult<Option<Bytes>>;
fn chain(&self) -> Arc<dyn BlockProvider>;
fn queue_info(&self) -> VerificationQueueInfo;
fn storage_at(
        &self,
        address: &Address,
        position: &H256,
        state: StateOrBlock
    ) -> Option<H256>;
fn list_accounts(
        &self,
        id: BlockId,
        after: Option<&Address>,
        count: u64
    ) -> Option<Vec<Address>>;
fn list_storage(
        &self,
        id: BlockId,
        account: &Address,
        after: Option<&H256>,
        count: Option<u64>
    ) -> Option<Vec<H256>>;
fn transaction(&self, id: TransactionId) -> Option<LocalizedTransaction>;
fn uncle(&self, id: UncleId) -> Option<Header>;
fn transaction_receipt(&self, id: TransactionId) -> Option<LocalizedReceipt>;
fn localized_block_receipts(
        &self,
        id: BlockId
    ) -> Option<Vec<LocalizedReceipt>>;
fn tree_route(&self, from: &H256, to: &H256) -> Option<TreeRoute>;
fn find_uncles(&self, hash: &H256) -> Option<Vec<H256>>;
fn state_data(&self, hash: &H256) -> Option<Bytes>;
fn block_receipts(&self, hash: &H256) -> Option<BlockReceipts>;
fn clear_queue(&self);
fn logs(&self, filter: Filter) -> Result<Vec<LocalizedLogEntry>, BlockId>;
fn replay(
        &self,
        t: TransactionId,
        analytics: CallAnalytics
    ) -> Result<Executed<FlatTrace, VMTrace>, CallError>;
fn replay_block_transactions(
        &self,
        block: BlockId,
        analytics: CallAnalytics
    ) -> Result<Box<dyn Iterator<Item = (H256, Executed<FlatTrace, VMTrace>)>>, CallError>;
fn filter_traces(&self, filter: TraceFilter) -> Option<Vec<LocalizedTrace>>;
fn trace(&self, trace: TraceId) -> Option<LocalizedTrace>;
fn transaction_traces(
        &self,
        trace: TransactionId
    ) -> Option<Vec<LocalizedTrace>>;
fn block_traces(&self, trace: BlockId) -> Option<Vec<LocalizedTrace>>;
fn last_hashes(&self) -> LastHashes;
fn transactions_to_propagate(&self) -> Vec<Arc<VerifiedTransaction>>;
fn signing_chain_id(&self) -> Option<u64>;
fn mode(&self) -> Mode;
fn set_mode(&self, mode: Mode);
fn spec_name(&self) -> String;
fn set_spec_name(&self, spec_name: String) -> Result<(), ()>;
fn disable(&self);
fn block_extra_info(&self, id: BlockId) -> Option<BTreeMap<String, String>>;
fn uncle_extra_info(&self, id: UncleId) -> Option<BTreeMap<String, String>>;
fn pruning_info(&self) -> PruningInfo;
fn create_transaction(
        &self,
        tx_request: TransactionRequest
    ) -> Result<SignedTransaction, Error>;
fn transact(&self, tx_request: TransactionRequest) -> Result<(), Error>; fn latest_code(&self, address: &Address) -> Option<Bytes> { ... }
fn latest_storage_at(&self, address: &Address, position: &H256) -> H256 { ... }
fn is_queue_empty(&self) -> bool { ... }
fn gas_price_corpus(&self, sample_size: usize) -> Corpus<U256> { ... } }

Blockchain database client. Owns and manages a blockchain and a block queue.

Required methods

fn block_number(&self, id: BlockId) -> Option<BlockNumber>[src]

Look up the block number for the given block ID.

fn block_body(&self, id: BlockId) -> Option<Body>[src]

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

fn block_status(&self, id: BlockId) -> BlockStatus[src]

Get block status by block header hash.

fn block_total_difficulty(&self, id: BlockId) -> Option<U256>[src]

Get block total difficulty.

fn storage_root(&self, address: &Address, id: BlockId) -> Option<H256>[src]

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

fn block_hash(&self, id: BlockId) -> Option<H256>[src]

Get block hash.

fn code(
    &self,
    address: &Address,
    state: StateOrBlock
) -> StateResult<Option<Bytes>>
[src]

Get address code at given block’s state.

fn chain(&self) -> Arc<dyn BlockProvider>[src]

Get a reference to the BlockProvider.

fn queue_info(&self) -> VerificationQueueInfo[src]

Get block queue information.

fn storage_at(
    &self,
    address: &Address,
    position: &H256,
    state: StateOrBlock
) -> Option<H256>
[src]

Get address code hash at given block’s state. Get value of the storage at given position at the given block’s state.

May not return None if given BlockId::Latest. Returns None if and only if the block’s root hash has been pruned from the DB.

fn list_accounts(
    &self,
    id: BlockId,
    after: Option<&Address>,
    count: u64
) -> Option<Vec<Address>>
[src]

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.

fn list_storage(
    &self,
    id: BlockId,
    account: &Address,
    after: Option<&H256>,
    count: Option<u64>
) -> Option<Vec<H256>>
[src]

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.

fn transaction(&self, id: TransactionId) -> Option<LocalizedTransaction>[src]

Get transaction with given hash.

fn uncle(&self, id: UncleId) -> Option<Header>[src]

Get uncle with given id.

fn transaction_receipt(&self, id: TransactionId) -> Option<LocalizedReceipt>[src]

Get transaction receipt with given hash.

fn localized_block_receipts(&self, id: BlockId) -> Option<Vec<LocalizedReceipt>>[src]

Get localized receipts for all transaction in given block.

fn tree_route(&self, from: &H256, to: &H256) -> Option<TreeRoute>[src]

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

fn find_uncles(&self, hash: &H256) -> Option<Vec<H256>>[src]

Get all possible uncle hashes for a block.

fn state_data(&self, hash: &H256) -> Option<Bytes>[src]

Get latest state node

fn block_receipts(&self, hash: &H256) -> Option<BlockReceipts>[src]

Get block receipts data by block header hash.

fn clear_queue(&self)[src]

Clear block queue and abort all import activity.

fn logs(&self, filter: Filter) -> Result<Vec<LocalizedLogEntry>, BlockId>[src]

Returns logs matching given filter. If one of the filtering block cannot be found, returns the block id that caused the error.

fn replay(
    &self,
    t: TransactionId,
    analytics: CallAnalytics
) -> Result<Executed<FlatTrace, VMTrace>, CallError>
[src]

Replays a given transaction for inspection.

fn replay_block_transactions(
    &self,
    block: BlockId,
    analytics: CallAnalytics
) -> Result<Box<dyn Iterator<Item = (H256, Executed<FlatTrace, VMTrace>)>>, CallError>
[src]

Replays all the transactions in a given block for inspection.

fn filter_traces(&self, filter: TraceFilter) -> Option<Vec<LocalizedTrace>>[src]

Returns traces matching given filter.

fn trace(&self, trace: TraceId) -> Option<LocalizedTrace>[src]

Returns trace with given id.

fn transaction_traces(
    &self,
    trace: TransactionId
) -> Option<Vec<LocalizedTrace>>
[src]

Returns traces created by transaction.

fn block_traces(&self, trace: BlockId) -> Option<Vec<LocalizedTrace>>[src]

Returns traces created by transaction from block.

fn last_hashes(&self) -> LastHashes[src]

Get last hashes starting from best block.

fn transactions_to_propagate(&self) -> Vec<Arc<VerifiedTransaction>>[src]

List all ready transactions that should be propagated to other peers.

fn signing_chain_id(&self) -> Option<u64>[src]

Get the preferred chain ID to sign on

fn mode(&self) -> Mode[src]

Get the mode.

fn set_mode(&self, mode: Mode)[src]

Set the mode.

fn spec_name(&self) -> String[src]

Get the chain spec name.

fn set_spec_name(&self, spec_name: String) -> Result<(), ()>[src]

Set the chain via a spec name.

fn disable(&self)[src]

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.

fn block_extra_info(&self, id: BlockId) -> Option<BTreeMap<String, String>>[src]

Returns engine-related extra info for BlockId.

fn uncle_extra_info(&self, id: UncleId) -> Option<BTreeMap<String, String>>[src]

Returns engine-related extra info for UncleId.

fn pruning_info(&self) -> PruningInfo[src]

Returns information about pruning/data availability.

fn create_transaction(
    &self,
    tx_request: TransactionRequest
) -> Result<SignedTransaction, Error>
[src]

Returns a transaction signed with the key configured in the engine signer.

fn transact(&self, tx_request: TransactionRequest) -> Result<(), Error>[src]

Schedule state-altering transaction to be executed on the next pending block with the given gas and nonce parameters.

Loading content...

Provided methods

fn latest_code(&self, address: &Address) -> Option<Bytes>[src]

Get address code at the latest block’s state.

fn latest_storage_at(&self, address: &Address, position: &H256) -> H256[src]

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

fn is_queue_empty(&self) -> bool[src]

Returns true if block queue is empty.

fn gas_price_corpus(&self, sample_size: usize) -> Corpus<U256>[src]

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

Loading content...

Implementors

Loading content...