Skip to content

Commit

Permalink
feat: exposes necessary methods on heap newtype (#43)
Browse files Browse the repository at this point in the history


Co-authored-by: Joonatan Saarhelo <[email protected]>
  • Loading branch information
montekki and joonazan authored Jun 5, 2024
1 parent 8d29257 commit 9342db7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ u256 = { package = "primitive-types", version = "0.12.1" }
enum_dispatch = "0.3"
arbitrary = { version = "1", features = ["derive"], optional = true }
zk_evm = { git = "https://github.com/matter-labs/era-zk_evm.git", branch = "v1.5.0", optional = true }
anyhow = { optional = true }
anyhow = { version = "1", optional = true }

[dev-dependencies]
divan = "0.1"
Expand Down
6 changes: 6 additions & 0 deletions src/heap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ impl HeapId {
#[derive(Debug, Clone, PartialEq)]
pub struct Heap(Vec<u8>);

impl Heap {
pub fn reserve(&mut self, additional: usize) {
self.0.reserve_exact(additional);
}
}

impl HeapInterface for Heap {
fn read_u256(&self, start_address: u32) -> U256 {
self.read_u256_partially(start_address..start_address + 32)
Expand Down

0 comments on commit 9342db7

Please sign in to comment.