Skip to content

Commit

Permalink
Ignore memory order in CairoPie validation.
Browse files Browse the repository at this point in the history
  • Loading branch information
Alon-Ti committed Jun 2, 2024
1 parent c65591e commit 26b381b
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion vm/src/vm/runners/cairo_pie.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,15 @@ pub struct CairoPieMemory(
pub Vec<((usize, usize), MaybeRelocatable)>,
);

impl CairoPieMemory {
fn as_hashmap(&self) -> HashMap<(usize, usize), MaybeRelocatable> {
self.0
.clone()
.into_iter()
.collect::<HashMap<(usize, usize), MaybeRelocatable>>()
}
}

#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq)]
pub struct PublicMemoryPage {
pub start: usize,
Expand Down Expand Up @@ -227,7 +236,7 @@ impl CairoPie {
if self.metadata != pie.metadata {
return Err(CairoPieValidationError::DiffMetadata);
}
if self.memory != pie.memory {
if self.memory.as_hashmap() != pie.memory.as_hashmap() {
return Err(CairoPieValidationError::DiffMemory);
}
if self.execution_resources.n_steps != pie.execution_resources.n_steps
Expand Down

0 comments on commit 26b381b

Please sign in to comment.