Trait EvmEnvProvider
pub trait EvmEnvProvider: Send + Sync {
// Required methods
fn fill_env_at<EvmConfig>(
&self,
cfg: &mut CfgEnvWithHandlerCfg,
block_env: &mut BlockEnv,
at: HashOrNumber,
evm_config: EvmConfig,
) -> Result<(), ProviderError>
where EvmConfig: ConfigureEvmEnv<Header = Header>;
fn fill_env_with_header<EvmConfig>(
&self,
cfg: &mut CfgEnvWithHandlerCfg,
block_env: &mut BlockEnv,
header: &Header,
evm_config: EvmConfig,
) -> Result<(), ProviderError>
where EvmConfig: ConfigureEvmEnv<Header = Header>;
fn fill_cfg_env_at<EvmConfig>(
&self,
cfg: &mut CfgEnvWithHandlerCfg,
at: HashOrNumber,
evm_config: EvmConfig,
) -> Result<(), ProviderError>
where EvmConfig: ConfigureEvmEnv<Header = Header>;
fn fill_cfg_env_with_header<EvmConfig>(
&self,
cfg: &mut CfgEnvWithHandlerCfg,
header: &Header,
evm_config: EvmConfig,
) -> Result<(), ProviderError>
where EvmConfig: ConfigureEvmEnv<Header = Header>;
// Provided method
fn env_with_header<EvmConfig>(
&self,
header: &Header,
evm_config: EvmConfig,
) -> Result<(CfgEnvWithHandlerCfg, BlockEnv), ProviderError>
where EvmConfig: ConfigureEvmEnv<Header = Header> { ... }
}
Expand description
A provider type that knows chain specific information required to configure a
[CfgEnvWithHandlerCfg
].
This type is mainly used to provide required data to configure the EVM environment that is usually stored on disk.
Required Methods§
fn fill_env_at<EvmConfig>(
&self,
cfg: &mut CfgEnvWithHandlerCfg,
block_env: &mut BlockEnv,
at: HashOrNumber,
evm_config: EvmConfig,
) -> Result<(), ProviderError>where
EvmConfig: ConfigureEvmEnv<Header = Header>,
fn fill_env_at<EvmConfig>(
&self,
cfg: &mut CfgEnvWithHandlerCfg,
block_env: &mut BlockEnv,
at: HashOrNumber,
evm_config: EvmConfig,
) -> Result<(), ProviderError>where
EvmConfig: ConfigureEvmEnv<Header = Header>,
Fills the [CfgEnvWithHandlerCfg
] and [BlockEnv] fields with values specific to the given
[BlockHashOrNumber].
fn fill_env_with_header<EvmConfig>(
&self,
cfg: &mut CfgEnvWithHandlerCfg,
block_env: &mut BlockEnv,
header: &Header,
evm_config: EvmConfig,
) -> Result<(), ProviderError>where
EvmConfig: ConfigureEvmEnv<Header = Header>,
fn fill_env_with_header<EvmConfig>(
&self,
cfg: &mut CfgEnvWithHandlerCfg,
block_env: &mut BlockEnv,
header: &Header,
evm_config: EvmConfig,
) -> Result<(), ProviderError>where
EvmConfig: ConfigureEvmEnv<Header = Header>,
Fills the [CfgEnvWithHandlerCfg
] and [BlockEnv] fields with values specific to the given
[Header].
fn fill_cfg_env_at<EvmConfig>(
&self,
cfg: &mut CfgEnvWithHandlerCfg,
at: HashOrNumber,
evm_config: EvmConfig,
) -> Result<(), ProviderError>where
EvmConfig: ConfigureEvmEnv<Header = Header>,
fn fill_cfg_env_at<EvmConfig>(
&self,
cfg: &mut CfgEnvWithHandlerCfg,
at: HashOrNumber,
evm_config: EvmConfig,
) -> Result<(), ProviderError>where
EvmConfig: ConfigureEvmEnv<Header = Header>,
Fills the [CfgEnvWithHandlerCfg
] fields with values specific to the given
[BlockHashOrNumber].
fn fill_cfg_env_with_header<EvmConfig>(
&self,
cfg: &mut CfgEnvWithHandlerCfg,
header: &Header,
evm_config: EvmConfig,
) -> Result<(), ProviderError>where
EvmConfig: ConfigureEvmEnv<Header = Header>,
fn fill_cfg_env_with_header<EvmConfig>(
&self,
cfg: &mut CfgEnvWithHandlerCfg,
header: &Header,
evm_config: EvmConfig,
) -> Result<(), ProviderError>where
EvmConfig: ConfigureEvmEnv<Header = Header>,
Fills the [CfgEnvWithHandlerCfg
] fields with values specific to the given [Header].
Provided Methods§
fn env_with_header<EvmConfig>(
&self,
header: &Header,
evm_config: EvmConfig,
) -> Result<(CfgEnvWithHandlerCfg, BlockEnv), ProviderError>where
EvmConfig: ConfigureEvmEnv<Header = Header>,
fn env_with_header<EvmConfig>(
&self,
header: &Header,
evm_config: EvmConfig,
) -> Result<(CfgEnvWithHandlerCfg, BlockEnv), ProviderError>where
EvmConfig: ConfigureEvmEnv<Header = Header>,
Fills the default [CfgEnvWithHandlerCfg
] and [BlockEnv] fields with values specific to the
given [Header].
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.
Implementations on Foreign Types§
§impl<'a, T> EvmEnvProvider for &'a T
impl<'a, T> EvmEnvProvider for &'a T
fn fill_env_at<EvmConfig>(
&self,
cfg: &mut CfgEnvWithHandlerCfg,
block_env: &mut BlockEnv,
at: HashOrNumber,
evm_config: EvmConfig,
) -> Result<(), ProviderError>where
EvmConfig: ConfigureEvmEnv<Header = Header>,
fn env_with_header<EvmConfig>(
&self,
header: &Header,
evm_config: EvmConfig,
) -> Result<(CfgEnvWithHandlerCfg, BlockEnv), ProviderError>where
EvmConfig: ConfigureEvmEnv<Header = Header>,
fn fill_env_with_header<EvmConfig>(
&self,
cfg: &mut CfgEnvWithHandlerCfg,
block_env: &mut BlockEnv,
header: &Header,
evm_config: EvmConfig,
) -> Result<(), ProviderError>where
EvmConfig: ConfigureEvmEnv<Header = Header>,
fn fill_cfg_env_at<EvmConfig>(
&self,
cfg: &mut CfgEnvWithHandlerCfg,
at: HashOrNumber,
evm_config: EvmConfig,
) -> Result<(), ProviderError>where
EvmConfig: ConfigureEvmEnv<Header = Header>,
fn fill_cfg_env_with_header<EvmConfig>(
&self,
cfg: &mut CfgEnvWithHandlerCfg,
header: &Header,
evm_config: EvmConfig,
) -> Result<(), ProviderError>where
EvmConfig: ConfigureEvmEnv<Header = Header>,
§impl<T> EvmEnvProvider for Arc<T>
impl<T> EvmEnvProvider for Arc<T>
fn fill_env_at<EvmConfig>(
&self,
cfg: &mut CfgEnvWithHandlerCfg,
block_env: &mut BlockEnv,
at: HashOrNumber,
evm_config: EvmConfig,
) -> Result<(), ProviderError>where
EvmConfig: ConfigureEvmEnv<Header = Header>,
fn env_with_header<EvmConfig>(
&self,
header: &Header,
evm_config: EvmConfig,
) -> Result<(CfgEnvWithHandlerCfg, BlockEnv), ProviderError>where
EvmConfig: ConfigureEvmEnv<Header = Header>,
fn fill_env_with_header<EvmConfig>(
&self,
cfg: &mut CfgEnvWithHandlerCfg,
block_env: &mut BlockEnv,
header: &Header,
evm_config: EvmConfig,
) -> Result<(), ProviderError>where
EvmConfig: ConfigureEvmEnv<Header = Header>,
fn fill_cfg_env_at<EvmConfig>(
&self,
cfg: &mut CfgEnvWithHandlerCfg,
at: HashOrNumber,
evm_config: EvmConfig,
) -> Result<(), ProviderError>where
EvmConfig: ConfigureEvmEnv<Header = Header>,
fn fill_cfg_env_with_header<EvmConfig>(
&self,
cfg: &mut CfgEnvWithHandlerCfg,
header: &Header,
evm_config: EvmConfig,
) -> Result<(), ProviderError>where
EvmConfig: ConfigureEvmEnv<Header = Header>,
Implementors§
impl EvmEnvProvider for MockEthProvider
test-utils
only.impl EvmEnvProvider for NoopProvider
test-utils
only.