Skip to content

Commit 9342db7

Browse files
montekkijoonazan
andauthored
feat: exposes necessary methods on heap newtype (matter-labs#43)
Co-authored-by: Joonatan Saarhelo <[email protected]>
1 parent 8d29257 commit 9342db7

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

Diff for: Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ u256 = { package = "primitive-types", version = "0.12.1" }
1414
enum_dispatch = "0.3"
1515
arbitrary = { version = "1", features = ["derive"], optional = true }
1616
zk_evm = { git = "https://github.com/matter-labs/era-zk_evm.git", branch = "v1.5.0", optional = true }
17-
anyhow = { optional = true }
17+
anyhow = { version = "1", optional = true }
1818

1919
[dev-dependencies]
2020
divan = "0.1"

Diff for: src/heap.rs

+6
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,12 @@ impl HeapId {
2020
#[derive(Debug, Clone, PartialEq)]
2121
pub struct Heap(Vec<u8>);
2222

23+
impl Heap {
24+
pub fn reserve(&mut self, additional: usize) {
25+
self.0.reserve_exact(additional);
26+
}
27+
}
28+
2329
impl HeapInterface for Heap {
2430
fn read_u256(&self, start_address: u32) -> U256 {
2531
self.read_u256_partially(start_address..start_address + 32)

0 commit comments

Comments
 (0)