pub trait LoadState:
LoadPendingBlock
+ EthApiTypes
+ RpcNodeCoreExtwhere
Self::Error: FromEvmError<Self::Evm> + FromEthApiError,
Self::RpcConvert: RpcConvert<Network = Self::NetworkTypes>,{
// Provided methods
fn state_at_hash(
&self,
block_hash: FixedBytes<32>,
) -> Result<Box<dyn StateProvider>, Self::Error> { ... }
fn state_at_block_id(
&self,
at: BlockId,
) -> impl Future<Output = Result<Box<dyn StateProvider>, Self::Error>> + Send
where Self: SpawnBlocking { ... }
fn latest_state(&self) -> Result<Box<dyn StateProvider>, Self::Error> { ... }
fn state_at_block_id_or_latest(
&self,
block_id: Option<BlockId>,
) -> impl Future<Output = Result<Box<dyn StateProvider>, Self::Error>> + Send
where Self: SpawnBlocking { ... }
fn evm_env_at(
&self,
at: BlockId,
) -> impl Future<Output = Result<(EvmEnv<<<<Self::Evm as ConfigureEvm>::BlockExecutorFactory as BlockExecutorFactory>::EvmFactory as EvmFactory>::Spec, <<<Self::Evm as ConfigureEvm>::BlockExecutorFactory as BlockExecutorFactory>::EvmFactory as EvmFactory>::BlockEnv>, BlockId), Self::Error>> + Send
where Self: SpawnBlocking { ... }
fn next_available_nonce(
&self,
address: Address,
) -> impl Future<Output = Result<u64, Self::Error>> + Send
where Self: SpawnBlocking { ... }
fn transaction_count(
&self,
address: Address,
block_id: Option<BlockId>,
) -> impl Future<Output = Result<Uint<256, 4>, Self::Error>> + Send
where Self: SpawnBlocking { ... }
fn get_code(
&self,
address: Address,
block_id: Option<BlockId>,
) -> impl Future<Output = Result<Bytes, Self::Error>> + Send
where Self: SpawnBlocking { ... }
}Expand description
Loads state from database.
Behaviour shared by several eth_ RPC methods, not exclusive to eth_ state RPC methods.
Provided Methods§
Sourcefn state_at_hash(
&self,
block_hash: FixedBytes<32>,
) -> Result<Box<dyn StateProvider>, Self::Error>
fn state_at_hash( &self, block_hash: FixedBytes<32>, ) -> Result<Box<dyn StateProvider>, Self::Error>
Returns the state at the given block number
Sourcefn state_at_block_id(
&self,
at: BlockId,
) -> impl Future<Output = Result<Box<dyn StateProvider>, Self::Error>> + Sendwhere
Self: SpawnBlocking,
fn state_at_block_id(
&self,
at: BlockId,
) -> impl Future<Output = Result<Box<dyn StateProvider>, Self::Error>> + Sendwhere
Self: SpawnBlocking,
Returns the state at the given BlockId enum.
Note: if not BlockNumberOrTag::Pending then this
will only return canonical state. See also https://github.com/paradigmxyz/reth/issues/4515
Sourcefn latest_state(&self) -> Result<Box<dyn StateProvider>, Self::Error>
fn latest_state(&self) -> Result<Box<dyn StateProvider>, Self::Error>
Returns the latest state
Sourcefn state_at_block_id_or_latest(
&self,
block_id: Option<BlockId>,
) -> impl Future<Output = Result<Box<dyn StateProvider>, Self::Error>> + Sendwhere
Self: SpawnBlocking,
fn state_at_block_id_or_latest(
&self,
block_id: Option<BlockId>,
) -> impl Future<Output = Result<Box<dyn StateProvider>, Self::Error>> + Sendwhere
Self: SpawnBlocking,
Returns the state at the given BlockId enum or the latest.
Convenience function to interprets None as BlockId::Number(BlockNumberOrTag::Latest)
Sourcefn evm_env_at(
&self,
at: BlockId,
) -> impl Future<Output = Result<(EvmEnv<<<<Self::Evm as ConfigureEvm>::BlockExecutorFactory as BlockExecutorFactory>::EvmFactory as EvmFactory>::Spec, <<<Self::Evm as ConfigureEvm>::BlockExecutorFactory as BlockExecutorFactory>::EvmFactory as EvmFactory>::BlockEnv>, BlockId), Self::Error>> + Sendwhere
Self: SpawnBlocking,
fn evm_env_at(
&self,
at: BlockId,
) -> impl Future<Output = Result<(EvmEnv<<<<Self::Evm as ConfigureEvm>::BlockExecutorFactory as BlockExecutorFactory>::EvmFactory as EvmFactory>::Spec, <<<Self::Evm as ConfigureEvm>::BlockExecutorFactory as BlockExecutorFactory>::EvmFactory as EvmFactory>::BlockEnv>, BlockId), Self::Error>> + Sendwhere
Self: SpawnBlocking,
Sourcefn next_available_nonce(
&self,
address: Address,
) -> impl Future<Output = Result<u64, Self::Error>> + Sendwhere
Self: SpawnBlocking,
fn next_available_nonce(
&self,
address: Address,
) -> impl Future<Output = Result<u64, Self::Error>> + Sendwhere
Self: SpawnBlocking,
Returns the next available nonce without gaps for the given address Next available nonce is either the on chain nonce of the account or the highest consecutive nonce in the pool + 1
Sourcefn transaction_count(
&self,
address: Address,
block_id: Option<BlockId>,
) -> impl Future<Output = Result<Uint<256, 4>, Self::Error>> + Sendwhere
Self: SpawnBlocking,
fn transaction_count(
&self,
address: Address,
block_id: Option<BlockId>,
) -> impl Future<Output = Result<Uint<256, 4>, Self::Error>> + Sendwhere
Self: SpawnBlocking,
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).
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.