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.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.