Trait reth_rpc_eth_api::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<U256, Self::Error>> + Send { ... }
fn get_code(
&self,
address: Address,
block_id: Option<BlockId>,
) -> impl Future<Output = Result<Bytes, Self::Error>> + Send { ... }
fn balance(
&self,
address: Address,
block_id: Option<BlockId>,
) -> impl Future<Output = Result<U256, Self::Error>> + Send { ... }
fn storage_at(
&self,
address: Address,
index: JsonStorageKey,
block_id: Option<BlockId>,
) -> impl Future<Output = Result<B256, Self::Error>> + Send { ... }
fn get_proof(
&self,
address: Address,
keys: Vec<JsonStorageKey>,
block_id: Option<BlockId>,
) -> Result<impl Future<Output = Result<EIP1186AccountProofResponse, Self::Error>> + Send, Self::Error>
where Self: EthApiSpec { ... }
fn get_account(
&self,
address: Address,
block_id: BlockId,
) -> impl Future<Output = Result<Option<Account>, Self::Error>> + Send { ... }
}
Expand description
Helper methods for eth_
methods relating to state (accounts).
Required Methods§
sourcefn max_proof_window(&self) -> u64
fn max_proof_window(&self) -> u64
Returns the maximum number of blocks into the past for generating state proofs.
Provided Methods§
sourcefn transaction_count(
&self,
address: Address,
block_id: Option<BlockId>,
) -> impl Future<Output = Result<U256, Self::Error>> + Send
fn transaction_count( &self, address: Address, block_id: Option<BlockId>, ) -> impl Future<Output = Result<U256, Self::Error>> + 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).
sourcefn get_code(
&self,
address: Address,
block_id: Option<BlockId>,
) -> impl Future<Output = Result<Bytes, Self::Error>> + Send
fn get_code( &self, address: Address, block_id: Option<BlockId>, ) -> impl Future<Output = Result<Bytes, Self::Error>> + Send
Returns code of given account, at given blocknumber.
sourcefn balance(
&self,
address: Address,
block_id: Option<BlockId>,
) -> impl Future<Output = Result<U256, Self::Error>> + Send
fn balance( &self, address: Address, block_id: Option<BlockId>, ) -> impl Future<Output = Result<U256, Self::Error>> + Send
Returns balance of given account, at given blocknumber.
sourcefn storage_at(
&self,
address: Address,
index: JsonStorageKey,
block_id: Option<BlockId>,
) -> impl Future<Output = Result<B256, Self::Error>> + Send
fn storage_at( &self, address: Address, index: JsonStorageKey, block_id: Option<BlockId>, ) -> impl Future<Output = Result<B256, Self::Error>> + Send
Returns values stored of given account, at given blocknumber.
sourcefn get_proof(
&self,
address: Address,
keys: Vec<JsonStorageKey>,
block_id: Option<BlockId>,
) -> Result<impl Future<Output = Result<EIP1186AccountProofResponse, Self::Error>> + Send, Self::Error>where
Self: EthApiSpec,
fn get_proof(
&self,
address: Address,
keys: Vec<JsonStorageKey>,
block_id: Option<BlockId>,
) -> Result<impl Future<Output = Result<EIP1186AccountProofResponse, Self::Error>> + Send, Self::Error>where
Self: EthApiSpec,
Returns values stored of given account, with Merkle-proof, at given blocknumber.
Object Safety§
This trait is not object safe.