pub trait EstimateCall: Call {
// Provided methods
fn estimate_gas_with<S>(
&self,
evm_env: <<Self::Evm as ConfigureEvm>::BlockExecutorFactory as BlockExecutorFactory>::EvmEnv,
request: <<Self::RpcConvert as RpcConvert>::Network as RpcTypes>::TransactionRequest,
state: S,
overrides: EvmOverrides,
) -> Result<Uint<256, 4>, Self::Error>
where S: EvmStateProvider { ... }
fn estimate_gas_at(
&self,
request: <<Self::RpcConvert as RpcConvert>::Network as RpcTypes>::TransactionRequest,
at: BlockId,
overrides: EvmOverrides,
) -> impl Future<Output = Result<Uint<256, 4>, Self::Error>> + Send
where Self: LoadPendingBlock { ... }
}Available on crate feature
rpc only.Expand description
Gas execution estimates
Provided Methods§
Sourcefn estimate_gas_with<S>(
&self,
evm_env: <<Self::Evm as ConfigureEvm>::BlockExecutorFactory as BlockExecutorFactory>::EvmEnv,
request: <<Self::RpcConvert as RpcConvert>::Network as RpcTypes>::TransactionRequest,
state: S,
overrides: EvmOverrides,
) -> Result<Uint<256, 4>, Self::Error>where
S: EvmStateProvider,
fn estimate_gas_with<S>(
&self,
evm_env: <<Self::Evm as ConfigureEvm>::BlockExecutorFactory as BlockExecutorFactory>::EvmEnv,
request: <<Self::RpcConvert as RpcConvert>::Network as RpcTypes>::TransactionRequest,
state: S,
overrides: EvmOverrides,
) -> Result<Uint<256, 4>, Self::Error>where
S: EvmStateProvider,
Estimates the gas usage of the request with the state.
This will execute the RpcTxReq and find the best gas limit via binary search.
§EVM settings
This modifies certain EVM settings to mirror geth’s SkipAccountChecks when transacting requests, see also: https://github.com/ethereum/go-ethereum/blob/380688c636a654becc8f114438c2a5d93d2db032/core/state_transition.go#L145-L148:
disable_eip3607is set totruedisable_base_feeis set totruedisable_fee_chargeis set totruenonceis set toNone
Sourcefn estimate_gas_at(
&self,
request: <<Self::RpcConvert as RpcConvert>::Network as RpcTypes>::TransactionRequest,
at: BlockId,
overrides: EvmOverrides,
) -> impl Future<Output = Result<Uint<256, 4>, Self::Error>> + Sendwhere
Self: LoadPendingBlock,
fn estimate_gas_at(
&self,
request: <<Self::RpcConvert as RpcConvert>::Network as RpcTypes>::TransactionRequest,
at: BlockId,
overrides: EvmOverrides,
) -> impl Future<Output = Result<Uint<256, 4>, Self::Error>> + Sendwhere
Self: LoadPendingBlock,
Estimate gas needed for execution of the request at the BlockId.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".