diff --git a/bus-mapping/src/eth_types.rs b/bus-mapping/src/eth_types.rs index 00b7c48369..12ada6bab3 100644 --- a/bus-mapping/src/eth_types.rs +++ b/bus-mapping/src/eth_types.rs @@ -183,28 +183,19 @@ impl From for GethExecStepInternal { .stack .0 .iter() - .map(|stack_elem| { - DebugU256::from_big_endian(&stack_elem.to_be_bytes()) - }) + .map(|stack_elem| DebugU256(stack_elem.0)) .collect(), memory: step .memory .0 - .iter() - .map(|mem_elem| { - DebugU256::from_big_endian(&mem_elem.to_be_bytes()) - }) + .chunks(32) + .map(|word| DebugU256::from_big_endian(word)) .collect(), storage: step .storage .0 .iter() - .map(|(k, v)| { - ( - DebugU256::from_big_endian(&k.to_be_bytes()), - DebugU256::from_big_endian(&v.to_be_bytes()), - ) - }) + .map(|(k, v)| (DebugU256(k.0), DebugU256(v.0))) .collect(), } } @@ -257,13 +248,13 @@ impl<'de> Deserialize<'de> for GethExecStep { /// `debug_traceBlockByHash` and `debug_traceBlockByNumber` Geth JSON-RPC calls. #[derive(Clone, Debug, Eq, PartialEq, Deserialize, Serialize)] #[doc(hidden)] -pub(crate) struct ResultGethExecTrace(pub(crate) Vec); +pub(crate) struct ResultGethExecTraces(pub(crate) Vec); /// Helper type built to deal with the weird `result` field added between `GethExecutionTrace`s in /// `debug_traceBlockByHash` and `debug_traceBlockByNumber` Geth JSON-RPC calls. #[derive(Clone, Debug, Eq, PartialEq, Deserialize, Serialize)] #[doc(hidden)] -pub(crate) struct ResultGethExecStep { +pub(crate) struct ResultGethExecTrace { pub(crate) result: GethExecTrace, } diff --git a/bus-mapping/src/rpc.rs b/bus-mapping/src/rpc.rs index 89d3e1e08c..8762b925ab 100644 --- a/bus-mapping/src/rpc.rs +++ b/bus-mapping/src/rpc.rs @@ -1,7 +1,7 @@ //! Module which contains all the RPC calls that are needed at any point to query a Geth node in order to get a Block, Tx or Trace info. use crate::eth_types::{ - Block, GethExecTrace, Hash, ResultGethExecTrace, Transaction, U64, + Block, GethExecTrace, Hash, ResultGethExecTraces, Transaction, U64, }; use crate::Error; use ethers_providers::JsonRpcClient; @@ -87,7 +87,7 @@ impl GethClient

{ hash: Hash, ) -> Result, Error> { let hash = serialize(&hash); - let resp: ResultGethExecTrace = self + let resp: ResultGethExecTraces = self .0 .request("debug_traceBlockByHash", [hash]) .await @@ -101,7 +101,7 @@ impl GethClient

{ block_num: BlockNumber, ) -> Result, Error> { let num = block_num.serialize(); - let resp: ResultGethExecTrace = self + let resp: ResultGethExecTraces = self .0 .request("debug_traceBlockByNumber", [num]) .await