From 0f254e16a50a6d39543fe59590227a09fd0e21bb Mon Sep 17 00:00:00 2001 From: Matthias Seitz Date: Tue, 24 Oct 2023 22:27:37 +0200 Subject: [PATCH] fix: return enveloped encoded (#5156) --- crates/rpc/rpc/src/debug.rs | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/crates/rpc/rpc/src/debug.rs b/crates/rpc/rpc/src/debug.rs index 9dd083c90..6c79e4ed2 100644 --- a/crates/rpc/rpc/src/debug.rs +++ b/crates/rpc/rpc/src/debug.rs @@ -897,13 +897,10 @@ where /// Returns the bytes of the transaction for the given hash. async fn raw_transaction(&self, hash: B256) -> RpcResult { let tx = self.inner.eth_api.transaction_by_hash(hash).await?; - - let mut res = Vec::new(); - if let Some(tx) = tx.map(TransactionSource::into_recovered) { - tx.encode(&mut res); - } - - Ok(res.into()) + Ok(tx + .map(TransactionSource::into_recovered) + .map(|tx| tx.envelope_encoded()) + .unwrap_or_default()) } /// Handler for `debug_getRawReceipts`