Skip to content

Commit

Permalink
test(blockifier): replace class revert
Browse files Browse the repository at this point in the history
test(blockifier): replace class revert
  • Loading branch information
AvivYossef-starkware committed Nov 20, 2024
1 parent 2beb6fd commit abddef2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 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>
) {
let 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,8 @@ mod TestContract {
}
},
};
// TODO(Yoni, 1/12/2024): test replace class once get_class_hash_at syscall is supported.
let class_hash_after_call = syscalls::get_class_hash_at_syscall(contract_address).unwrap_syscall();
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.');
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ use crate::execution::call_info::CallExecution;
use crate::execution::contract_class::TrackedResource;
use crate::execution::entry_point::CallEntryPoint;
use crate::retdata;
use crate::state::state_api::StateReader;
use crate::test_utils::contracts::FeatureContract;
use crate::test_utils::initial_test_state::test_state;
use crate::test_utils::syscall::build_recurse_calldata;
Expand Down Expand Up @@ -62,10 +61,6 @@ fn test_call_contract_that_panics() {
);
assert!(inner_call.execution.events.is_empty());
assert!(inner_call.execution.l2_to_l1_messages.is_empty());
assert_eq!(
state.get_class_hash_at(inner_call.call.storage_address).unwrap(),
test_contract.get_class_hash()
);
}

#[cfg_attr(
Expand Down

0 comments on commit abddef2

Please sign in to comment.