Trait reth::core::rpc::api::servers::eth::helpers::state::EthState

source ·
pub trait EthState: LoadState + SpawnBlocking {
    // Required method
    fn max_proof_window(&self) -> u64;

    // Provided methods
    fn transaction_count(
        &self,
        address: Address,
        block_id: Option<BlockId>,
    ) -> impl Future<Output = Result<Uint<256, 4>, EthApiError>> + Send { ... }
    fn get_code(
        &self,
        address: Address,
        block_id: Option<BlockId>,
    ) -> impl Future<Output = Result<Bytes, EthApiError>> + Send { ... }
    fn balance(
        &self,
        address: Address,
        block_id: Option<BlockId>,
    ) -> impl Future<Output = Result<Uint<256, 4>, EthApiError>> + Send { ... }
    fn storage_at(
        &self,
        address: Address,
        index: JsonStorageKey,
        block_id: Option<BlockId>,
    ) -> impl Future<Output = Result<FixedBytes<32>, EthApiError>> + Send { ... }
    fn get_proof(
        &self,
        address: Address,
        keys: Vec<JsonStorageKey>,
        block_id: Option<BlockId>,
    ) -> Result<impl Future<Output = Result<EIP1186AccountProofResponse, EthApiError>> + Send, EthApiError>
       where Self: EthApiSpec { ... }
}
Expand description

Helper methods for eth_ methods relating to state (accounts).

Required Methods§

source

fn max_proof_window(&self) -> u64

Returns the maximum number of blocks into the past for generating state proofs.

Provided Methods§

source

fn transaction_count( &self, address: Address, block_id: Option<BlockId>, ) -> impl Future<Output = Result<Uint<256, 4>, EthApiError>> + Send

Returns the number of transactions sent from an address at the given block identifier.

If this is BlockNumberOrTag::Pending then this will look up the highest transaction in pool and return the next nonce (highest + 1).

source

fn get_code( &self, address: Address, block_id: Option<BlockId>, ) -> impl Future<Output = Result<Bytes, EthApiError>> + Send

Returns code of given account, at given blocknumber.

source

fn balance( &self, address: Address, block_id: Option<BlockId>, ) -> impl Future<Output = Result<Uint<256, 4>, EthApiError>> + Send

Returns balance of given account, at given blocknumber.

source

fn storage_at( &self, address: Address, index: JsonStorageKey, block_id: Option<BlockId>, ) -> impl Future<Output = Result<FixedBytes<32>, EthApiError>> + Send

Returns values stored of given account, at given blocknumber.

source

fn get_proof( &self, address: Address, keys: Vec<JsonStorageKey>, block_id: Option<BlockId>, ) -> Result<impl Future<Output = Result<EIP1186AccountProofResponse, EthApiError>> + Send, EthApiError>
where Self: EthApiSpec,

Returns values stored of given account, with Merkle-proof, at given blocknumber.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<Provider, Pool, Network, EvmConfig> EthState for EthApi<Provider, Pool, Network, EvmConfig>
where EthApi<Provider, Pool, Network, EvmConfig>: LoadState + SpawnBlocking,