Skip to content

Commit 33156c6

Browse files
starknet_os_flow_tests: fuzz test library call scenario
1 parent a9bd158 commit 33156c6

10 files changed

Lines changed: 1561 additions & 614 deletions

File tree

crates/blockifier_test_utils/resources/feature_contracts/cairo0/compiled/fuzz_revert_compiled.json

Lines changed: 205 additions & 62 deletions
Large diffs are not rendered by default.

crates/blockifier_test_utils/resources/feature_contracts/cairo0/fuzz_revert.cairo

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,13 @@
22

33
from starkware.cairo.common.cairo_builtins import HashBuiltin
44
from starkware.cairo.common.math import assert_not_zero
5-
from starkware.starknet.common.syscalls import call_contract
5+
from starkware.starknet.common.syscalls import call_contract, library_call
66

77
// Scenarios.
88
// The RETURN scenario *must* be zero, as the zero value also indicates end of scenario stream.
99
const SCENARIO_RETURN = 0;
1010
const SCENARIO_CALL = 1;
11+
const SCENARIO_LIBRARY_CALL = 2;
1112

1213
// selector_from_name("pop_front").
1314
const POP_FRONT_SELECTOR = 0x289c2d7d6351cd03d4f928bde75fa14d5f52e32bdbc750d5296e1b48c12f1c3;
@@ -82,6 +83,17 @@ func test_revert_fuzz{syscall_ptr: felt*, pedersen_ptr: HashBuiltin*, range_chec
8283
return ();
8384
}
8485

86+
if (scenario == SCENARIO_LIBRARY_CALL) {
87+
library_call(
88+
class_hash=pop_front(orchestrator),
89+
function_selector=FUZZ_TEST_SELECTOR,
90+
calldata_size=0,
91+
calldata=new(),
92+
);
93+
test_revert_fuzz();
94+
return ();
95+
}
96+
8597
with_attr error_message("Unknown scenario: {scenario}.") {
8698
assert 1 = 0;
8799
}

0 commit comments

Comments
 (0)