Skip to content

Commit

Permalink
remove tests that check caller is not the zero address
Browse files Browse the repository at this point in the history
  • Loading branch information
ggonzalez94 committed Nov 18, 2024
1 parent f4a41ba commit 94ad425
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 64 deletions.
1 change: 0 additions & 1 deletion packages/access/src/ownable/ownable.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ pub mod OwnableComponent {
pub mod Errors {
pub const NOT_OWNER: felt252 = 'Caller is not the owner';
pub const NOT_PENDING_OWNER: felt252 = 'Caller is not the pending owner';
pub const ZERO_ADDRESS_CALLER: felt252 = 'Caller is the zero address';
pub const ZERO_ADDRESS_OWNER: felt252 = 'New owner is the zero address';
}

Expand Down
35 changes: 0 additions & 35 deletions packages/access/src/tests/test_ownable.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,6 @@ fn test_assert_only_owner_when_not_owner() {
state.assert_only_owner();
}

#[test]
#[should_panic(expected: ('Caller is the zero address',))]
fn test_assert_only_owner_when_caller_zero() {
let state = setup();
state.assert_only_owner();
}

//
// _transfer_ownership
//
Expand Down Expand Up @@ -124,13 +117,6 @@ fn test_transfer_ownership_to_zero() {
state.transfer_ownership(ZERO());
}

#[test]
#[should_panic(expected: ('Caller is the zero address',))]
fn test_transfer_ownership_from_zero() {
let mut state = setup();
state.transfer_ownership(OTHER());
}

#[test]
#[should_panic(expected: ('Caller is not the owner',))]
fn test_transfer_ownership_from_nonowner() {
Expand Down Expand Up @@ -159,13 +145,6 @@ fn test_transferOwnership_to_zero() {
state.transferOwnership(ZERO());
}

#[test]
#[should_panic(expected: ('Caller is the zero address',))]
fn test_transferOwnership_from_zero() {
let mut state = setup();
state.transferOwnership(OTHER());
}

#[test]
#[should_panic(expected: ('Caller is not the owner',))]
fn test_transferOwnership_from_nonowner() {
Expand All @@ -190,13 +169,6 @@ fn test_renounce_ownership() {
assert!(state.owner().is_zero());
}

#[test]
#[should_panic(expected: ('Caller is the zero address',))]
fn test_renounce_ownership_from_zero_address() {
let mut state = setup();
state.renounce_ownership();
}

#[test]
#[should_panic(expected: ('Caller is not the owner',))]
fn test_renounce_ownership_from_nonowner() {
Expand All @@ -217,13 +189,6 @@ fn test_renounceOwnership() {
assert!(state.owner().is_zero());
}

#[test]
#[should_panic(expected: ('Caller is the zero address',))]
fn test_renounceOwnership_from_zero_address() {
let mut state = setup();
state.renounceOwnership();
}

#[test]
#[should_panic(expected: ('Caller is not the owner',))]
fn test_renounceOwnership_from_nonowner() {
Expand Down
28 changes: 0 additions & 28 deletions packages/access/src/tests/test_ownable_twostep.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -96,13 +96,6 @@ fn test_transfer_ownership_to_zero() {
assert_eq!(state.pending_owner(), ZERO());
}

#[test]
#[should_panic(expected: ('Caller is the zero address',))]
fn test_transfer_ownership_from_zero() {
let mut state = setup();
state.transfer_ownership(OTHER());
}

#[test]
#[should_panic(expected: ('Caller is not the owner',))]
fn test_transfer_ownership_from_nonowner() {
Expand Down Expand Up @@ -144,13 +137,6 @@ fn test_transferOwnership_to_zero() {
assert!(state.pendingOwner().is_zero());
}

#[test]
#[should_panic(expected: ('Caller is the zero address',))]
fn test_transferOwnership_from_zero() {
let mut state = setup();
state.transferOwnership(OTHER());
}

#[test]
#[should_panic(expected: ('Caller is not the owner',))]
fn test_transferOwnership_from_nonowner() {
Expand Down Expand Up @@ -244,13 +230,6 @@ fn test_renounce_ownership_resets_pending_owner() {
assert!(current_pending_owner.is_zero());
}

#[test]
#[should_panic(expected: ('Caller is the zero address',))]
fn test_renounce_ownership_from_zero_address() {
let mut state = setup();
state.renounce_ownership();
}

#[test]
#[should_panic(expected: ('Caller is not the owner',))]
fn test_renounce_ownership_from_nonowner() {
Expand All @@ -272,13 +251,6 @@ fn test_renounceOwnership() {
assert!(state.owner().is_zero());
}

#[test]
#[should_panic(expected: ('Caller is the zero address',))]
fn test_renounceOwnership_from_zero_address() {
let mut state = setup();
state.renounceOwnership();
}

#[test]
#[should_panic(expected: ('Caller is not the owner',))]
fn test_renounceOwnership_from_nonowner() {
Expand Down

0 comments on commit 94ad425

Please sign in to comment.