Skip to content

Commit

Permalink
test(blockifier): replace class revert
Browse files Browse the repository at this point in the history
  • Loading branch information
AvivYossef-starkware committed Nov 19, 2024
1 parent 27a4c29 commit fc5c984
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -624,6 +624,7 @@ mod TestContract {
entry_point_selector: felt252,
calldata: Array::<felt252>
) {
class_hash_before_call := syscalls::get_class_hash_at_syscall(contract_address).unwrap_syscall();
match syscalls::call_contract_syscall(
contract_address, entry_point_selector, calldata.span())
{
Expand All @@ -642,7 +643,9 @@ mod TestContract {
}
},
};
class_hash_after_call := syscalls::get_class_hash_at_syscall(contract_address).unwrap_syscall();
// TODO(Yoni, 1/12/2024): test replace class once get_class_hash_at syscall is supported.
assert(self.my_storage_var.read() == 0, 'values should not change.');
assert(class_hash_before_call == class_hash_after_call, 'class hash should not change if the tx reverted.');
}
}

0 comments on commit fc5c984

Please sign in to comment.