From 68a546f8ef1f1513ff0bd3c91db1e07528a41547 Mon Sep 17 00:00:00 2001 From: Pia Date: Wed, 3 Apr 2024 13:57:54 +0900 Subject: [PATCH] rlp encode --- src/tx.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/tx.rs b/src/tx.rs index f5525a4..53bb454 100644 --- a/src/tx.rs +++ b/src/tx.rs @@ -4,12 +4,19 @@ use alloy_consensus::{ }; use alloy_eips::eip2930::AccessList; use alloy_eips::eip2930::AccessListItem; +use alloy_network::eip2718::Encodable2718; use alloy_primitives::{Parity, Signature, TxKind, U64}; use alloy_rpc_types::Transaction; #[derive(Debug, Clone)] pub struct ConsensusTx(pub TxEnvelope); +impl ConsensusTx { + pub fn rlp_encode(&self) -> Vec { + self.0.encoded_2718() + } +} + #[derive(Debug, Clone)] pub(crate) struct RpcTx(pub Transaction);