Skip to content

Commit

Permalink
Merge pull request #1297 from o1-labs/dannywillems/memory-decode-asse…
Browse files Browse the repository at this point in the history
…rt-length

Check page size
  • Loading branch information
dannywillems authored Oct 24, 2023
2 parents 3026234 + 44891fb commit f6dd0a5
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions optimism/src/cannon.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ use regex::Regex;
use serde::{Deserialize, Deserializer, Serialize};
use std::io::Read;

pub const PAGE_SIZE: usize = 4096;

#[derive(Serialize, Deserialize, Debug)]
pub struct Page {
pub index: u32,
Expand All @@ -22,6 +24,7 @@ where
let mut decoder = Decoder::new(&b64_decoded[..]).unwrap();
let mut data = Vec::new();
decoder.read_to_end(&mut data).unwrap();
assert_eq!(data.len(), PAGE_SIZE);
Ok(data)
}

Expand Down

0 comments on commit f6dd0a5

Please sign in to comment.