From aff0e8d4d2a443d5e3be520df859c92a04e85959 Mon Sep 17 00:00:00 2001 From: FrancoGiachetta Date: Mon, 8 Jul 2024 18:01:26 -0300 Subject: [PATCH] changes on RpcCallInfo --- rpc-state-reader/src/blockifier_state_reader.rs | 8 ++++---- rpc-state-reader/src/rpc_state.rs | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/rpc-state-reader/src/blockifier_state_reader.rs b/rpc-state-reader/src/blockifier_state_reader.rs index e4c4af3..c34e17f 100644 --- a/rpc-state-reader/src/blockifier_state_reader.rs +++ b/rpc-state-reader/src/blockifier_state_reader.rs @@ -619,7 +619,7 @@ mod tests { let (tx_info, trace, _receipt) = execute_tx(hash, chain, BlockNumber(block_number)); // We cannot currently check fee & resources - + // Compare tx CallInfos against trace RpcCallInfos // Note: This will check calldata, retdata, internal calls and make sure the tx is not reverted. // It will not chekced accessed or modified storage, messanges, and events (as they are not currenlty part of the RpcCallInfo) @@ -643,13 +643,13 @@ mod tests { internal_calls: value.inner_calls.iter().map(|ci| ci.into()).collect(), // We don't have the revert reason string in the trace so we just make sure it doesn't revert revert_reason: value.execution.failed.then_some("Default String".into()), - events: value.execution.events.iter().map(|e| e.into()).collect(), - l2_l1_messages: value + events: Some(value.execution.events.iter().map(|e| e.into()).collect()), + l2_l1_messages: Some(value .execution .l2_to_l1_messages .iter() .map(|llm| llm.into()) - .collect(), + .collect()), } } } diff --git a/rpc-state-reader/src/rpc_state.rs b/rpc-state-reader/src/rpc_state.rs index 51e24d1..93d761a 100644 --- a/rpc-state-reader/src/rpc_state.rs +++ b/rpc-state-reader/src/rpc_state.rs @@ -202,8 +202,8 @@ pub struct RpcCallInfo { pub calldata: Option>, pub internal_calls: Vec, pub revert_reason: Option, - pub events: Vec, - pub l2_l1_messages: Vec, + pub events: Option>, + pub l2_l1_messages: Option>, } #[derive(Debug, Deserialize)] @@ -374,8 +374,8 @@ impl<'de> Deserialize<'de> for RpcCallInfo { calldata, internal_calls, revert_reason: None, - events, - l2_l1_messages, + events: Some(events), + l2_l1_messages: Some(l2_l1_messages), }) } }