Skip to content

Commit

Permalink
Fix tests + fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
fmoletta committed Apr 18, 2024
1 parent 92e69ee commit 5b54cfa
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
6 changes: 3 additions & 3 deletions vm/src/tests/cairo_pie_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ fn pedersen_test() {
),
(BuiltinName::range_check, BuiltinAdditionalData::None),
]);
assert_eq!(cairo_pie.additional_data, expected_additional_data);
assert_eq!(cairo_pie.additional_data.0, expected_additional_data);
// memory
assert_eq!(
cairo_pie.memory,
Expand Down Expand Up @@ -177,7 +177,7 @@ fn common_signature() {
),
)])),
)]);
assert_eq!(cairo_pie.additional_data, expected_additional_data);
assert_eq!(cairo_pie.additional_data.0, expected_additional_data);
// memory
assert_eq!(
cairo_pie.memory,
Expand Down Expand Up @@ -236,7 +236,7 @@ fn relocate_segments() {
};
assert_eq!(cairo_pie.execution_resources, expected_execution_resources);
// additional_data
assert!(cairo_pie.additional_data.is_empty());
assert!(cairo_pie.additional_data.0.is_empty());
// memory
assert_eq!(
cairo_pie.memory,
Expand Down
2 changes: 1 addition & 1 deletion vm/src/vm/runners/cairo_pie.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ pub enum BuiltinAdditionalData {
#[derive(Serialize, Clone, Debug, PartialEq, Eq)]
pub struct CairoPieAdditionalData(
#[serde(with = "crate::types::builtin_name::serde_generic_map_impl")]
pub HashMap<BuiltinName, BuiltinAdditionalData>
pub HashMap<BuiltinName, BuiltinAdditionalData>,
);

#[derive(Serialize, Clone, Debug, PartialEq, Eq)]
Expand Down
11 changes: 6 additions & 5 deletions vm/src/vm/runners/cairo_runner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1426,11 +1426,12 @@ impl CairoRunner {
metadata,
memory: (&vm.segments.memory).into(),
execution_resources: self.get_execution_resources(vm)?,
additional_data: CairoPieAdditionalData(vm
.builtin_runners
.iter()
.map(|b| (b.name(), b.get_additional_data()))
.collect()),
additional_data: CairoPieAdditionalData(
vm.builtin_runners
.iter()
.map(|b| (b.name(), b.get_additional_data()))
.collect(),
),
version: CairoPieVersion { cairo_pie: () },
})
}
Expand Down

0 comments on commit 5b54cfa

Please sign in to comment.