From 9bbfe3b0a6a382f8daf87d9648f68fc75f344915 Mon Sep 17 00:00:00 2001 From: 0xaatif Date: Wed, 15 May 2024 15:27:41 +0800 Subject: [PATCH] fix: decode in ops --- ops/src/lib.rs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/ops/src/lib.rs b/ops/src/lib.rs index 33fa1f9..d9b7343 100644 --- a/ops/src/lib.rs +++ b/ops/src/lib.rs @@ -32,11 +32,10 @@ impl Operation for TxProof { .signed_txn .as_ref() .map(|txn| { - use alloy::rpc::types::eth::Transaction; - fn decode(_: &[u8]) -> Transaction { - todo!("rlp::decode::") // TODO(aatifsyed) - } - decode(txn).hash.to_string() + // https://docs.rs/ethers-core/2.0.14/src/ethers_core/types/transaction/response.rs.html#404 + // https://docs.rs/rlp/latest/src/rlp/rlpin.rs.html#136 + let hash = alloy::primitives::keccak256(txn); + hash.to_string() }) .unwrap_or_else(|| { format!(