Skip to content
This repository has been archived by the owner on Aug 21, 2024. It is now read-only.

feat: derive Clone for call info related types #1950

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 5 additions & 9 deletions crates/blockifier/src/execution/call_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ macro_rules! retdata {
};
}

#[cfg_attr(test, derive(Clone))]
#[derive(Debug, Default, Eq, PartialEq, Serialize)]
#[derive(Clone, Debug, Default, Eq, PartialEq, Serialize)]
pub struct OrderedEvent {
pub order: usize,
pub event: EventContent,
Expand Down Expand Up @@ -53,23 +52,20 @@ impl MessageL1CostInfo {
}
}

#[cfg_attr(test, derive(Clone))]
#[derive(Debug, Default, Eq, PartialEq, Serialize)]
#[derive(Clone, Debug, Default, Eq, PartialEq, Serialize)]
pub struct MessageToL1 {
pub to_address: EthAddress,
pub payload: L2ToL1Payload,
}

#[cfg_attr(test, derive(Clone))]
#[derive(Debug, Default, Eq, PartialEq, Serialize)]
#[derive(Clone, Debug, Default, Eq, PartialEq, Serialize)]
pub struct OrderedL2ToL1Message {
pub order: usize,
pub message: MessageToL1,
}

/// Represents the effects of executing a single entry point.
#[cfg_attr(test, derive(Clone))]
#[derive(Debug, Default, Eq, PartialEq, Serialize)]
#[derive(Clone, Debug, Default, Eq, PartialEq, Serialize)]
pub struct CallExecution {
pub retdata: Retdata,
pub events: Vec<OrderedEvent>,
Expand All @@ -88,7 +84,7 @@ struct ExecutionResourcesDef {
}

/// Represents the full effects of executing an entry point, including the inner calls it invoked.
#[derive(Debug, Default, Eq, PartialEq, Serialize)]
#[derive(Clone, Debug, Default, Eq, PartialEq, Serialize)]
pub struct CallInfo {
pub call: CallEntryPoint,
pub execution: CallExecution,
Expand Down
1 change: 1 addition & 0 deletions crates/blockifier/src/execution/entry_point_execution.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ pub struct VmExecutionContext<'a> {
pub program_extra_data_length: usize,
}

#[derive(Clone, Debug)]
pub struct CallResult {
pub failed: bool,
pub retdata: Retdata,
Expand Down
Loading