Skip to content

Commit

Permalink
test: use assert macro
Browse files Browse the repository at this point in the history
  • Loading branch information
obatirou committed Nov 26, 2024
1 parent f8a6526 commit fa028eb
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions cairo/protocol_handler/tests/test_protocol_handler.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -656,13 +656,11 @@ fn test_protocol_handler_change_operator_should_pass() {
let access_control_dispatcher = IAccessControlDispatcher {
contract_address: protocol_handler.contract_address
};
assert(
assert!(
!access_control_dispatcher.has_role(ProtocolHandler::OPERATOR_ROLE, operator_mock()),
'Old operator not revoked'
);
assert(
assert!(
access_control_dispatcher.has_role(ProtocolHandler::OPERATOR_ROLE, new_operator),
'New operator not granted'
);

// Check the Access control related events are emitted
Expand All @@ -688,7 +686,7 @@ fn test_protocol_handler_change_operator_should_pass() {

// Check the new operator is set in the contract state
let loaded = load(protocol_handler.contract_address, selector!("operator"), 1);
assert_eq!(*loaded[0], new_operator.into(), "New operator not set");
assert_eq!(*loaded[0], new_operator.into());
}


Expand Down

0 comments on commit fa028eb

Please sign in to comment.