Skip to main content

FoundryTxConversion

Trait FoundryTxConversion 

Source
pub trait FoundryTxConversion<N>: EvmTypesHost
where N: Network,
{ // Required methods fn evm_tx( envelope: <N as Network>::TxEnvelope, sender: Address, payload: TxPayload, ) -> Result<Recovered<Self::Tx>, Report>; fn envelope_from_any_rpc( tx: &AnyRpcTransaction, ) -> Result<<N as Network>::TxEnvelope, Report>; // Provided methods fn tx_from_request( request: <N as Network>::TransactionRequest, ) -> Result<Recovered<Self::Tx>, Report> where <N as Network>::TransactionRequest: NetworkTransactionBuilder<N>, <N as Network>::UnsignedTx: SignableTransaction<Signature>, <N as Network>::TxEnvelope: From<Signed<<N as Network>::UnsignedTx>> { ... } fn tx_from_signed( envelope: <N as Network>::TxEnvelope, ) -> Result<Recovered<Self::Tx>, Report> where <N as Network>::TxEnvelope: SignerRecoverable { ... } fn decode_tx(bytes: &[u8]) -> Result<Recovered<Self::Tx>, Report> where <N as Network>::TxEnvelope: SignerRecoverable { ... } fn tx_from_any_rpc( tx: &AnyRpcTransaction, ) -> Result<Recovered<Self::Tx>, Report> { ... } }
Expand description

Converts an Alloy network’s native transactions into an evm2 execution family’s transactions.

The family, rather than the transaction type alone, owns conversion: families can share a transaction representation while retaining different conversion policies and diagnostics.

Required Methods§

Source

fn evm_tx( envelope: <N as Network>::TxEnvelope, sender: Address, payload: TxPayload, ) -> Result<Recovered<Self::Tx>, Report>

Converts a network envelope sent by sender, once, right before execution.

Source

fn envelope_from_any_rpc( tx: &AnyRpcTransaction, ) -> Result<<N as Network>::TxEnvelope, Report>

Converts a transaction fetched over RPC into this network’s envelope.

Envelopes this family cannot represent fail rather than being projected onto another type.

Provided Methods§

Source

fn tx_from_request( request: <N as Network>::TransactionRequest, ) -> Result<Recovered<Self::Tx>, Report>
where <N as Network>::TransactionRequest: NetworkTransactionBuilder<N>, <N as Network>::UnsignedTx: SignableTransaction<Signature>, <N as Network>::TxEnvelope: From<Signed<<N as Network>::UnsignedTx>>,

Converts a complete unsigned request into a simulated transaction.

The request must name its sender and carry every field its transaction type needs; Foundry fills defaults through [TransactionBuilder] before converting, never afterwards.

Source

fn tx_from_signed( envelope: <N as Network>::TxEnvelope, ) -> Result<Recovered<Self::Tx>, Report>
where <N as Network>::TxEnvelope: SignerRecoverable,

Converts a signed envelope into a transaction sent by its recovered signer.

Source

fn decode_tx(bytes: &[u8]) -> Result<Recovered<Self::Tx>, Report>
where <N as Network>::TxEnvelope: SignerRecoverable,

Decodes exactly the EIP-2718 bytes that were signed and converts them for execution.

Source

fn tx_from_any_rpc( tx: &AnyRpcTransaction, ) -> Result<Recovered<Self::Tx>, Report>

Converts a transaction fetched over RPC, using its RPC sender as it executed on chain.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl FoundryTxConversion<Base> for BaseEvmTypes

Source§

fn evm_tx( envelope: BaseTxEnvelope, sender: Address, payload: TxPayload, ) -> Result<Recovered<BaseTxEnvelope>, Report>

Source§

fn envelope_from_any_rpc( tx: &AnyRpcTransaction, ) -> Result<BaseTxEnvelope, Report>

Source§

impl FoundryTxConversion<Ethereum> for BaseEvmTypes

Source§

fn evm_tx( envelope: EthereumTxEnvelope<TxEip4844Variant>, sender: Address, _payload: TxPayload, ) -> Result<Recovered<TxEnvelope>, Report>

Source§

fn tx_from_request( request: TransactionRequest, ) -> Result<Recovered<TxEnvelope>, Report>

Source§

fn envelope_from_any_rpc( tx: &AnyRpcTransaction, ) -> Result<EthereumTxEnvelope<TxEip4844Variant>, Report>

Source§

impl FoundryTxConversion<Ethereum> for MonadEvmTypes

Source§

fn evm_tx( envelope: EthereumTxEnvelope<TxEip4844Variant>, sender: Address, _payload: TxPayload, ) -> Result<Recovered<TxEnvelope>, Report>

Source§

fn tx_from_request( request: TransactionRequest, ) -> Result<Recovered<TxEnvelope>, Report>

Source§

fn envelope_from_any_rpc( tx: &AnyRpcTransaction, ) -> Result<EthereumTxEnvelope<TxEip4844Variant>, Report>

Source§

impl FoundryTxConversion<Optimism> for OpEvmTypes

Source§

fn evm_tx( envelope: OpTxEnvelope, sender: Address, payload: TxPayload, ) -> Result<Recovered<OpTxEnvelope>, Report>

Source§

fn envelope_from_any_rpc(tx: &AnyRpcTransaction) -> Result<OpTxEnvelope, Report>

Source§

impl FoundryTxConversion<TempoNetwork> for TempoEvmTypes

Source§

fn evm_tx( envelope: <<TempoEvmNetwork as FoundryEvmNetwork>::Network as Network>::TxEnvelope, sender: Address, payload: TxPayload, ) -> Result<Recovered<TempoTxEnv>, Report>

Source§

fn tx_from_request( request: <<TempoEvmNetwork as FoundryEvmNetwork>::Network as Network>::TransactionRequest, ) -> Result<Recovered<TempoTxEnv>, Report>

Source§

fn envelope_from_any_rpc( tx: &AnyRpcTransaction, ) -> Result<<<TempoEvmNetwork as FoundryEvmNetwork>::Network as Network>::TxEnvelope, Report>

Implementors§