Skip to content

Commit

Permalink
changes on RpcCallInfo
Browse files Browse the repository at this point in the history
  • Loading branch information
FrancoGiachetta committed Jul 8, 2024
1 parent 5ad25f1 commit aff0e8d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions rpc-state-reader/src/blockifier_state_reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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()),
}
}
}
Expand Down
8 changes: 4 additions & 4 deletions rpc-state-reader/src/rpc_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,8 @@ pub struct RpcCallInfo {
pub calldata: Option<Vec<StarkFelt>>,
pub internal_calls: Vec<RpcCallInfo>,
pub revert_reason: Option<String>,
pub events: Vec<Event>,
pub l2_l1_messages: Vec<L2ToL1Msg>,
pub events: Option<Vec<Event>>,
pub l2_l1_messages: Option<Vec<L2ToL1Msg>>,
}

#[derive(Debug, Deserialize)]
Expand Down Expand Up @@ -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),
})
}
}
Expand Down

0 comments on commit aff0e8d

Please sign in to comment.