From 9919b7a35056560eee2dfe0880dc3efb025dc42e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roman=20Hodul=C3=A1k?= Date: Tue, 20 May 2025 16:56:22 +0200 Subject: [PATCH] feat: Implement conversion from built-in transaction envelopes into `Extended` (#16366) --- crates/primitives-traits/src/extended.rs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/crates/primitives-traits/src/extended.rs b/crates/primitives-traits/src/extended.rs index 6c701396ab..4fdfeaf9d8 100644 --- a/crates/primitives-traits/src/extended.rs +++ b/crates/primitives-traits/src/extended.rs @@ -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 From> for Extended, Tx> { + fn from(value: EthereumTxEnvelope) -> Self { + Self::BuiltIn(value) + } +} + #[cfg(feature = "op")] mod op { use crate::Extended; @@ -309,6 +315,12 @@ mod op { } } } + + impl From for Extended { + fn from(value: OpTxEnvelope) -> Self { + Self::BuiltIn(value) + } + } } #[cfg(feature = "serde-bincode-compat")]