feat: Implement conversion from built-in transaction envelopes into Extended (#16366)

This commit is contained in:
Roman Hodulák
2025-05-20 16:56:22 +02:00
committed by GitHub
parent 0de50d3b7b
commit 9919b7a350

View File

@@ -3,7 +3,7 @@ use crate::{
transaction::signed::{RecoveryError, SignedTransaction},
};
use alloc::vec::Vec;
use alloy_consensus::{transaction::SignerRecoverable, Transaction};
use alloy_consensus::{transaction::SignerRecoverable, EthereumTxEnvelope, Transaction};
use alloy_eips::{
eip2718::{Eip2718Error, Eip2718Result, IsTyped2718},
eip2930::AccessList,
@@ -264,6 +264,12 @@ where
}
}
impl<Eip4844, Tx> From<EthereumTxEnvelope<Eip4844>> for Extended<EthereumTxEnvelope<Eip4844>, Tx> {
fn from(value: EthereumTxEnvelope<Eip4844>) -> Self {
Self::BuiltIn(value)
}
}
#[cfg(feature = "op")]
mod op {
use crate::Extended;
@@ -309,6 +315,12 @@ mod op {
}
}
}
impl<Tx> From<OpTxEnvelope> for Extended<OpTxEnvelope, Tx> {
fn from(value: OpTxEnvelope) -> Self {
Self::BuiltIn(value)
}
}
}
#[cfg(feature = "serde-bincode-compat")]