Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 21 additions & 9 deletions crates/evm/src/tx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -356,13 +356,13 @@ mod op {
use op_revm::{transaction::deposit::DepositTransactionParts, OpTransaction};
use revm::context::TxEnv;

impl FromTxWithEncoded<OpTxEnvelope> for OpTransaction<TxEnv> {
fn from_encoded_tx(tx: &OpTxEnvelope, caller: Address, encoded: Bytes) -> Self {
let base = match tx {
OpTxEnvelope::Legacy(tx) => TxEnv::from_recovered_tx(tx.tx(), caller),
OpTxEnvelope::Eip1559(tx) => TxEnv::from_recovered_tx(tx.tx(), caller),
OpTxEnvelope::Eip2930(tx) => TxEnv::from_recovered_tx(tx.tx(), caller),
OpTxEnvelope::Eip7702(tx) => TxEnv::from_recovered_tx(tx.tx(), caller),
impl FromRecoveredTx<OpTxEnvelope> for TxEnv {
fn from_recovered_tx(tx: &OpTxEnvelope, caller: Address) -> Self {
match tx {
OpTxEnvelope::Legacy(tx) => Self::from_recovered_tx(tx.tx(), caller),
OpTxEnvelope::Eip1559(tx) => Self::from_recovered_tx(tx.tx(), caller),
OpTxEnvelope::Eip2930(tx) => Self::from_recovered_tx(tx.tx(), caller),
OpTxEnvelope::Eip7702(tx) => Self::from_recovered_tx(tx.tx(), caller),
OpTxEnvelope::Deposit(tx) => {
let TxDeposit {
to,
Expand All @@ -374,7 +374,7 @@ mod op {
mint: _,
is_system_transaction: _,
} = tx.inner();
TxEnv {
Self {
tx_type: tx.ty(),
caller,
gas_limit: *gas_limit,
Expand All @@ -384,7 +384,19 @@ mod op {
..Default::default()
}
}
};
}
}
}

impl FromTxWithEncoded<OpTxEnvelope> for TxEnv {
fn from_encoded_tx(tx: &OpTxEnvelope, caller: Address, _encoded: Bytes) -> Self {
Self::from_recovered_tx(tx, caller)
}
}

impl FromTxWithEncoded<OpTxEnvelope> for OpTransaction<TxEnv> {
fn from_encoded_tx(tx: &OpTxEnvelope, caller: Address, encoded: Bytes) -> Self {
let base = TxEnv::from_recovered_tx(tx, caller);

let deposit = if let OpTxEnvelope::Deposit(tx) = tx {
DepositTransactionParts {
Expand Down