-
Notifications
You must be signed in to change notification settings - Fork 71
Closed
Labels
enhancementNew feature or requestNew feature or request
Description
Describe the feature you would like
rn we only support going from the envelope to the OpTransaction<TxEnv>
Lines 45 to 50 in f3e5d1d
| impl FromTxWithEncoded<OpTxEnvelope> for TxEnv { | |
| fn from_encoded_tx(tx: &OpTxEnvelope, caller: Address, _encoded: Bytes) -> Self { | |
| Self::from_recovered_tx(tx, caller) | |
| } | |
| } | |
Lines 51 to 67 in f3e5d1d
| 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 { | |
| source_hash: tx.source_hash, | |
| mint: Some(tx.mint), | |
| is_system_transaction: tx.is_system_transaction, | |
| } | |
| } else { | |
| Default::default() | |
| }; | |
| Self { base, enveloped_tx: Some(encoded), deposit } | |
| } | |
| } |
while for just TxEnv we also support:
Lines 255 to 261 in f3e5d1d
| impl FromTxWithEncoded<TxEip4844> for TxEnv { | |
| fn from_encoded_tx(tx: &TxEip4844, sender: Address, _encoded: Bytes) -> Self { | |
| Self::from_recovered_tx(tx, sender) | |
| } | |
| } | |
| impl FromRecoveredTx<TxEip7702> for TxEnv { |
ideally we have the same
this means effectively inlining this per tx implementation:
Lines 51 to 65 in f3e5d1d
| 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 { | |
| source_hash: tx.source_hash, | |
| mint: Some(tx.mint), | |
| is_system_transaction: tx.is_system_transaction, | |
| } | |
| } else { | |
| Default::default() | |
| }; | |
| Self { base, enveloped_tx: Some(encoded), deposit } |
and then updating this impl for envelope like:
Line 431 in f3e5d1d
| impl<Eip4844: AsRef<TxEip4844>> FromTxWithEncoded<EthereumTxEnvelope<Eip4844>> for TxEnv { |
Additional context
No response
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request