Trait IntoTxEnv
pub trait IntoTxEnv<TxEnv> {
// Required method
fn into_tx_env(self) -> TxEnv;
}
Available on crate feature
evm
only.Expand description
Trait marking types that can be converted into a transaction environment.
This is the primary trait that enables flexible transaction input for the EVM. The EVM’s
associated type Evm::Tx
must implement this trait, and the transact
method accepts
any type implementing IntoTxEnv<Evm::Tx>
.
§Example
ⓘ
// Direct TxEnv usage
let tx_env = TxEnv { caller: address, gas_limit: 100_000, ... };
evm.transact(tx_env)?;
// Using a recovered transaction
let recovered = tx.recover_signer()?;
evm.transact(recovered)?;
// Using a transaction with encoded bytes
let with_encoded = WithEncoded::new(recovered, encoded_bytes);
evm.transact(with_encoded)?;
Required Methods§
fn into_tx_env(self) -> TxEnv
fn into_tx_env(self) -> TxEnv
Converts self
into TxEnv
.