Skip to content

Implement alloy_evm traits for anvil txtypes #12390

@mattsse

Description

@mattsse

Component

Anvil

Describe the feature you would like

we currently do:

pub fn to_revm_tx_env(&self) -> OpTransaction<TxEnv> {

but all of this is already implemented here:

https://github.com/alloy-rs/evm/blob/f3e5d1df7cb77ca3bbae58bb74d6b8b3fe4bd93e/crates/evm/src/op/tx.rs#L9-L9

and

https://github.com/alloy-rs/evm/blob/f3e5d1df7cb77ca3bbae58bb74d6b8b3fe4bd93e/crates/evm/src/op/tx.rs#L51-L67

this means we can more or less simplify this with

impl FromRecoveredTx<TypedTransaction> for TxEnv {
    fn from_recovered_tx(tx: &TypedTransaction, sender: Address) -> Self {
        todo!()
    }
}

impl FromRecoveredTx<TypedTransaction> for OpTransaction<TxEnv> {
    fn from_recovered_tx(tx: &TypedTransaction, sender: Address) -> Self {
        todo!()
    }
}

TODO

  • implement these alloy_evm traits
  • replace to_revm_tx_env entirely

@mablr

Additional context

No response

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

Status

Backlog

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions