Skip to content

Commit

Permalink
dev: refactor to use assert!
Browse files Browse the repository at this point in the history
  • Loading branch information
Harsh Bajpai authored and Harsh Bajpai committed Nov 29, 2023
1 parent e705d2e commit 0384964
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions crates/evm/src/tests/test_call_helpers.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ fn test_prepare_call_type_call() {

let call_args = machine.prepare_call(@CallType::Call).unwrap();

assert(call_args == expected_call_args, 'wrong calls_args prepared');
assert!(call_args == expected_call_args, "wrong calls_args prepared");
}

#[test]
Expand Down Expand Up @@ -158,7 +158,7 @@ fn test_prepare_call_type_delegate_call() {

let call_args = machine.prepare_call(@CallType::DelegateCall).unwrap();

assert(call_args == expected_call_args, 'wrong calls_args prepared');
assert!(call_args == expected_call_args, "wrong calls_args prepared");
}

#[test]
Expand Down Expand Up @@ -199,7 +199,7 @@ fn test_prepare_call_type_call_code() {

let call_args = machine.prepare_call(@CallType::CallCode).unwrap();

assert(call_args == expected_call_args, 'wrong calls_args prepared');
assert!(call_args == expected_call_args, "wrong calls_args prepared");
}

#[test]
Expand Down Expand Up @@ -240,7 +240,7 @@ fn test_prepare_call_type_static_call() {

let call_args = machine.prepare_call(@CallType::StaticCall).unwrap();

assert(call_args == expected_call_args, 'wrong calls_args prepared');
assert!(call_args == expected_call_args, "wrong calls_args prepared");
}


Expand Down Expand Up @@ -296,16 +296,16 @@ fn test_init_call_sub_ctx() {
let sender_balance_after = machine.state.get_account(sender_address).balance;
let reciver_balance_after = machine.state.get_account(address).balance;

assert(
assert!(
machine
.address() == Address {
evm: address, starknet: kakarot_core.compute_starknet_address(address)
},
'wrong execution context address'
"wrong execution context address"
);

assert(sender_balance_prev - sender_balance_after == 100, 'wrong sender balance');
assert(reciver_balance_after - reciver_balance_prev == 100, 'wrong reciever balance');
assert!(sender_balance_prev - sender_balance_after == 100, "wrong sender balance");
assert!(reciver_balance_after - reciver_balance_prev == 100, "wrong reciever balance");

assert!(ctx_count_after - ctx_count_prev == 1, "ctx count increased by wrong value");
}

0 comments on commit 0384964

Please sign in to comment.