Skip to content

Commit 9cd6151

Browse files
starknet_os_flow_tests: fuzz test orchestrator address in contract state
1 parent fee963a commit 9cd6151

10 files changed

Lines changed: 2426 additions & 97 deletions

File tree

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

Lines changed: 536 additions & 6 deletions
Large diffs are not rendered by default.
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,34 @@
11
%lang starknet
2+
3+
from starkware.cairo.common.cairo_builtins import HashBuiltin
4+
5+
@storage_var
6+
func orchestrator_address() -> (address: felt) {
7+
}
8+
9+
/// If this contract is deployed as part of the fuzz test "deploy" scenario, the orchestrator
10+
/// address must be provided. Otherwise, deploy with [0] as args.
11+
@constructor
12+
func constructor{syscall_ptr: felt*, pedersen_ptr: HashBuiltin*, range_check_ptr}(
13+
maybe_orchestrator_address: felt,
14+
) {
15+
if (maybe_orchestrator_address != 0) {
16+
initialize(maybe_orchestrator_address);
17+
tempvar syscall_ptr = syscall_ptr;
18+
tempvar pedersen_ptr = pedersen_ptr;
19+
tempvar range_check_ptr = range_check_ptr;
20+
} else {
21+
tempvar syscall_ptr = syscall_ptr;
22+
tempvar pedersen_ptr = pedersen_ptr;
23+
tempvar range_check_ptr = range_check_ptr;
24+
}
25+
return ();
26+
}
27+
28+
@external
29+
func initialize{syscall_ptr: felt*, pedersen_ptr: HashBuiltin*, range_check_ptr}(
30+
orchestrator_address_input: felt
31+
) {
32+
orchestrator_address.write(orchestrator_address_input);
33+
return ();
34+
}

0 commit comments

Comments
 (0)