Skip to content

Commit 1c4f35c

Browse files
feat: Implement from_recovered_tx for txDeposit nativel (#96)
* feat: Implement from_recovered_tx for txDeposit nativel * update TxDeposit
1 parent 8383f16 commit 1c4f35c

File tree

1 file changed

+25
-21
lines changed

1 file changed

+25
-21
lines changed

crates/evm/src/tx.rs

Lines changed: 25 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -363,27 +363,31 @@ mod op {
363363
OpTxEnvelope::Eip1559(tx) => Self::from_recovered_tx(tx.tx(), caller),
364364
OpTxEnvelope::Eip2930(tx) => Self::from_recovered_tx(tx.tx(), caller),
365365
OpTxEnvelope::Eip7702(tx) => Self::from_recovered_tx(tx.tx(), caller),
366-
OpTxEnvelope::Deposit(tx) => {
367-
let TxDeposit {
368-
to,
369-
value,
370-
gas_limit,
371-
input,
372-
source_hash: _,
373-
from: _,
374-
mint: _,
375-
is_system_transaction: _,
376-
} = tx.inner();
377-
Self {
378-
tx_type: tx.ty(),
379-
caller,
380-
gas_limit: *gas_limit,
381-
kind: *to,
382-
value: *value,
383-
data: input.clone(),
384-
..Default::default()
385-
}
386-
}
366+
OpTxEnvelope::Deposit(tx) => Self::from_recovered_tx(tx.inner(), caller),
367+
}
368+
}
369+
}
370+
371+
impl FromRecoveredTx<TxDeposit> for TxEnv {
372+
fn from_recovered_tx(tx: &TxDeposit, caller: Address) -> Self {
373+
let TxDeposit {
374+
to,
375+
value,
376+
gas_limit,
377+
input,
378+
source_hash: _,
379+
from: _,
380+
mint: _,
381+
is_system_transaction: _,
382+
} = tx;
383+
Self {
384+
tx_type: tx.ty(),
385+
caller,
386+
gas_limit: *gas_limit,
387+
kind: *to,
388+
value: *value,
389+
data: input.clone(),
390+
..Default::default()
387391
}
388392
}
389393
}

0 commit comments

Comments
 (0)