Skip to content

Commit 593d9a7

Browse files
authored
fix : Fix CairoRunner::get_memory_holes (#1027)
* Add test * Ignore builtin segments in get_memory_holes * Improve test * Add memory holes check for cairo_run_test tests * Fix broken condition * Make memory_holes check optional & customizable * Fix bounds * Add a test with deliberately created memory holes * Fix test value * Remove duplicated tests + add memory hole value to some tests * Add memory holes value + remove duplicated tests + fix typo * Fix test values * Add changelog entry * Link PR in Changelog * Mark breaking change in changelog * fmt * Fix test value * Fix codecov-patch diff
1 parent cdc28b0 commit 593d9a7

File tree

7 files changed

+186
-709
lines changed

7 files changed

+186
-709
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
22

33
#### Upcoming Changes
44

5+
* BREAKING CHANGE: Fix `CairoRunner::get_memory_holes` [#1027](https://github.com/lambdaclass/cairo-rs/pull/1027):
6+
7+
* Skip builtin segements when counting memory holes
8+
* Check amount of memory holes for all tests in cairo_run_test
9+
* Remove duplicated tests in cairo_run_test
10+
* BREAKING CHANGE: `MemorySegmentManager.get_memory_holes` now also receives the amount of builtins in the vm. Signature is now `pub fn get_memory_holes(&self, builtin_count: usize) -> Result<usize, MemoryError>`
11+
512
* Add missing hint on uint256_improvements lib [#1025](https://github.com/lambdaclass/cairo-rs/pull/1025):
613

714
`BuiltinHintProcessor` now supports the following hint:

cairo_programs/memory_holes.cairo

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
func main() {
2+
// Deliberately create memory holes
3+
assert [ap + 5] = 1;
4+
return ();
5+
}

0 commit comments

Comments
 (0)