fix: return enveloped encoded (#5156)

This commit is contained in:
Matthias Seitz
2023-10-24 22:27:37 +02:00
committed by GitHub
parent 572a41eafb
commit 0f254e16a5

View File

@ -897,13 +897,10 @@ where
/// Returns the bytes of the transaction for the given hash.
async fn raw_transaction(&self, hash: B256) -> RpcResult<Bytes> {
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`