Skip to content
Open
Show file tree
Hide file tree
Changes from 19 commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
1810acb
chore: control test names
Ifechukwudaniel Jul 9, 2025
e625615
chore: owners test renamed
Ifechukwudaniel Jul 9, 2025
61c48c5
chore: code format
Ifechukwudaniel Jul 9, 2025
f5a8242
chore: vesting and erc1155
Ifechukwudaniel Jul 10, 2025
c3e7115
chore: renamed tests
Ifechukwudaniel Jul 11, 2025
038508c
chore: fixed more test names
Ifechukwudaniel Jul 11, 2025
786ede3
chore: renamed test in crypto lib
Ifechukwudaniel Jul 11, 2025
2ee5493
Merge branch 'main' into test-names
Ifechukwudaniel Jul 11, 2025
c82e524
chore: control , ecdsa, erc20 test names
Ifechukwudaniel Jul 11, 2025
5ee29ea
chore: flash mint
Ifechukwudaniel Jul 11, 2025
ba93906
chore:safe test and vesting
Ifechukwudaniel Jul 12, 2025
1d7e41d
chore: testname changes
Ifechukwudaniel Jul 12, 2025
c5f996a
chore: fixed test
Ifechukwudaniel Jul 12, 2025
c41bca0
chore: fixes
Ifechukwudaniel Jul 12, 2025
7d1ffa5
chore: fmt
Ifechukwudaniel Jul 12, 2025
ef16231
chore: erc20-permit
Ifechukwudaniel Jul 12, 2025
87b9055
chore: fixes
Ifechukwudaniel Aug 3, 2025
d86ac58
chore: mrege
Ifechukwudaniel Aug 3, 2025
9969136
Merge branch 'main' into test-names
bidzyyys Aug 8, 2025
082c279
Update contracts/src/access/ownable.rs
Ifechukwudaniel Aug 20, 2025
5e835f2
Merge branch 'main' into test-names
Ifechukwudaniel Aug 20, 2025
ad36e94
Update examples/erc1155/tests/erc1155.rs
Ifechukwudaniel Aug 20, 2025
d083fcb
Update contracts/src/token/erc20/extensions/flash_mint.rs
Ifechukwudaniel Aug 20, 2025
ecf8c5c
Update examples/erc1155/tests/erc1155.rs
Ifechukwudaniel Aug 20, 2025
4c86d6e
Update contracts/src/token/erc20/extensions/capped.rs
Ifechukwudaniel Aug 20, 2025
53bc2bb
Update examples/access-control/tests/access_control.rs
Ifechukwudaniel Aug 20, 2025
683ddd8
Update contracts/src/access/ownable_two_step.rs
Ifechukwudaniel Aug 20, 2025
c35f9c0
Update examples/access-control/tests/access_control.rs
Ifechukwudaniel Aug 20, 2025
92e0c83
Update contracts/src/token/erc721/extensions/consecutive.rs
Ifechukwudaniel Aug 20, 2025
3b59973
chore: code format
Ifechukwudaniel Aug 20, 2025
ef45964
Update examples/access-control/tests/access_control.rs
Ifechukwudaniel Aug 20, 2025
5208b09
Update examples/access-control/tests/access_control.rs
Ifechukwudaniel Aug 20, 2025
a2eefc3
chore: format
Ifechukwudaniel Aug 20, 2025
66fb548
chore: fixes
Ifechukwudaniel Aug 20, 2025
01fb0c2
chore: fixes
Ifechukwudaniel Aug 20, 2025
604b1b3
chore: remove interface_id test in this file. It's not useful
Ifechukwudaniel Aug 20, 2025
b3ac34c
chore:format
Ifechukwudaniel Aug 20, 2025
c32fbe2
chore: removed _transfer_ownership_updates_owner_storage testcase
Ifechukwudaniel Aug 20, 2025
fff060c
Merge branch 'main' into test-names
Ifechukwudaniel Aug 22, 2025
4835bf4
chore: erc1155 or erc20
Ifechukwudaniel Aug 24, 2025
597708b
chore: burnable and erc1155
Ifechukwudaniel Aug 25, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 21 additions & 21 deletions contracts/src/access/control/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,7 @@ mod tests {
unsafe impl TopLevelStorage for AccessControl {}

#[motsu::test]
fn default_role_is_default_admin(
fn get_role_admin_returns_default_admin_for_standard_role(
contract: Contract<AccessControl>,
alice: Address,
) {
Expand All @@ -457,7 +457,7 @@ mod tests {
}

#[motsu::test]
fn default_admin_roles_admin_is_itself(
fn get_role_admin_returns_default_admin_for_default_admin_role(
contract: Contract<AccessControl>,
alice: Address,
) {
Expand All @@ -467,7 +467,7 @@ mod tests {
}

#[motsu::test]
fn non_admin_cannot_grant_role_to_others(
fn grant_role_reverts_when_not_admin(
contract: Contract<AccessControl>,
alice: Address,
bob: Address,
Expand All @@ -478,7 +478,7 @@ mod tests {
}

#[motsu::test]
fn accounts_can_be_granted_roles_multiple_times(
fn grant_role_succeeds_assigning_role_multiple_times(
contract: Contract<AccessControl>,
alice: Address,
bob: Address,
Expand All @@ -492,7 +492,7 @@ mod tests {
}

#[motsu::test]
fn not_granted_roles_can_be_revoked(
fn revoke_role_succeeds_removing_ungranted_role(
contract: Contract<AccessControl>,
alice: Address,
bob: Address,
Expand All @@ -507,7 +507,7 @@ mod tests {
}

#[motsu::test]
fn admin_can_revoke_role(
fn revoke_role_succeeds_removing_granted_role(
contract: Contract<AccessControl>,
alice: Address,
bob: Address,
Expand All @@ -523,7 +523,7 @@ mod tests {
}

#[motsu::test]
fn non_admin_cannot_revoke_role(
fn revoke_role_reverts_when_not_admin(
contract: Contract<AccessControl>,
alice: Address,
bob: Address,
Expand All @@ -538,7 +538,7 @@ mod tests {
}

#[motsu::test]
fn roles_can_be_revoked_multiple_times(
fn revoke_role_succeeds_removing_role_multiple_times(
contract: Contract<AccessControl>,
alice: Address,
bob: Address,
Expand All @@ -552,7 +552,7 @@ mod tests {
}

#[motsu::test]
fn bearer_can_renounce_role(
fn renounce_role_succeeds_removing_own_role(
contract: Contract<AccessControl>,
alice: Address,
) {
Expand All @@ -566,7 +566,7 @@ mod tests {
}

#[motsu::test]
fn only_sender_can_renounce(
fn renounce_role_reverts_when_not_sender(
contract: Contract<AccessControl>,
alice: Address,
bob: Address,
Expand All @@ -578,7 +578,7 @@ mod tests {
}

#[motsu::test]
fn roles_can_be_renounced_multiple_times(
fn renounce_role_succeeds_removing_role_multiple_times(
contract: Contract<AccessControl>,
alice: Address,
bob: Address,
Expand All @@ -592,7 +592,7 @@ mod tests {
}

#[motsu::test]
fn a_roles_admin_role_can_change(
fn _set_role_admin_succeeds_updating_admin_role(
contract: Contract<AccessControl>,
alice: Address,
) {
Expand All @@ -604,7 +604,7 @@ mod tests {
}

#[motsu::test]
fn the_new_admin_can_grant_roles(
fn grant_role_succeeds_assigning_role_with_new_admin(
contract: Contract<AccessControl>,
alice: Address,
bob: Address,
Expand All @@ -618,7 +618,7 @@ mod tests {
}

#[motsu::test]
fn the_new_admin_can_revoke_roles(
fn revoke_role_succeeds_removing_role_with_new_admins(
contract: Contract<AccessControl>,
alice: Address,
bob: Address,
Expand All @@ -633,7 +633,7 @@ mod tests {
}

#[motsu::test]
fn previous_admins_no_longer_grant_roles(
fn grant_role_reverts_when_called_by_old_admin(
contract: Contract<AccessControl>,
alice: Address,
bob: Address,
Expand All @@ -647,7 +647,7 @@ mod tests {
}

#[motsu::test]
fn previous_admins_no_longer_revoke_roles(
fn revoke_role_reverts_when_called_by_old_admin(
contract: Contract<AccessControl>,
alice: Address,
bob: Address,
Expand All @@ -661,7 +661,7 @@ mod tests {
}

#[motsu::test]
fn does_not_revert_if_sender_has_role(
fn _check_role_succeeds_verifying_granted_role(
contract: Contract<AccessControl>,
alice: Address,
) {
Expand All @@ -686,7 +686,7 @@ mod tests {
}

#[motsu::test]
fn internal_grant_role_true_if_no_role(
fn _grant_role_true_if_no_role(
contract: Contract<AccessControl>,
alice: Address,
bob: Address,
Expand All @@ -696,7 +696,7 @@ mod tests {
}

#[motsu::test]
fn internal_grant_role_false_if_role(
fn _grant_role_succeeds_with_existing_role(
contract: Contract<AccessControl>,
alice: Address,
bob: Address,
Expand All @@ -708,7 +708,7 @@ mod tests {
}

#[motsu::test]
fn internal_revoke_role_true_if_role(
fn _revoke_role_succeeds_removing_existing_role(
contract: Contract<AccessControl>,
alice: Address,
bob: Address,
Expand All @@ -721,7 +721,7 @@ mod tests {
}

#[motsu::test]
fn internal_revoke_role_false_if_no_role(
fn _revoke_role_succeeds_with_nonexistent_role(
contract: Contract<AccessControl>,
alice: Address,
bob: Address,
Expand Down
13 changes: 6 additions & 7 deletions contracts/src/access/ownable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,6 @@ mod tests {
#[motsu::test]
fn constructor(contract: Contract<Ownable>, alice: Address) {
contract.sender(alice).constructor(alice).unwrap();

let owner = contract.sender(alice).owner();
assert_eq!(owner, alice);

Expand All @@ -318,7 +317,7 @@ mod tests {
}

#[motsu::test]
fn transfers_ownership(
fn transfer_ownership_updates_owner_address(
contract: Contract<Ownable>,
alice: Address,
bob: Address,
Expand All @@ -339,7 +338,7 @@ mod tests {
}

#[motsu::test]
fn prevents_non_owners_from_transferring(
fn transfer_ownership_reverts_when_not_owner(
contract: Contract<Ownable>,
alice: Address,
bob: Address,
Expand All @@ -351,7 +350,7 @@ mod tests {
}

#[motsu::test]
fn prevents_reaching_stuck_state(
fn transfer_ownership_reverts_when_zero_address(
contract: Contract<Ownable>,
alice: Address,
) {
Expand All @@ -366,7 +365,7 @@ mod tests {
}

#[motsu::test]
fn loses_ownership_after_renouncing(
fn renounce_ownership_sets_zero_address(
contract: Contract<Ownable>,
alice: Address,
) {
Expand All @@ -386,7 +385,7 @@ mod tests {
}

#[motsu::test]
fn prevents_non_owners_from_renouncing(
fn renounce_ownership_reverts_when_not_owner(
contract: Contract<Ownable>,
alice: Address,
bob: Address,
Expand All @@ -398,7 +397,7 @@ mod tests {
}

#[motsu::test]
fn recovers_access_using_internal_transfer(
fn _transfer_ownership_updates_owner_storage(
contract: Contract<Ownable>,
alice: Address,
bob: Address,
Expand Down
26 changes: 14 additions & 12 deletions contracts/src/access/ownable_two_step.rs
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ mod tests {
}

#[motsu::test]
fn reads_pending_owner(
fn pending_owner_returns_current_address(
contract: Contract<Ownable2Step>,
alice: Address,
bob: Address,
Expand All @@ -263,7 +263,7 @@ mod tests {
}

#[motsu::test]
fn initiates_ownership_transfer(
fn transfer_ownership_succeeds_updating_pending_owner(
contract: Contract<Ownable2Step>,
alice: Address,
bob: Address,
Expand All @@ -279,7 +279,7 @@ mod tests {
}

#[motsu::test]
fn prevents_non_owners_from_initiating_transfer(
fn transfer_ownership_reverts_when_not_owner(
contract: Contract<Ownable2Step>,
alice: Address,
bob: Address,
Expand All @@ -297,7 +297,7 @@ mod tests {
}

#[motsu::test]
fn accepts_ownership(
fn accept_ownership_succeeds_completing_transfer(
contract: Contract<Ownable2Step>,
alice: Address,
bob: Address,
Expand All @@ -314,7 +314,7 @@ mod tests {
}

#[motsu::test]
fn prevents_non_pending_owner_from_accepting(
fn accept_ownership_reverts_when_not_pending_owner(
contract: Contract<Ownable2Step>,
alice: Address,
bob: Address,
Expand All @@ -333,7 +333,7 @@ mod tests {
}

#[motsu::test]
fn completes_two_step_ownership_transfer(
fn transfer_ownership_succeeds_with_complete_flow(
contract: Contract<Ownable2Step>,
alice: Address,
bob: Address,
Expand All @@ -356,9 +356,11 @@ mod tests {
}

#[motsu::test]
fn renounces_ownership(contract: Contract<Ownable2Step>, alice: Address) {
fn renounce_ownership_succeeds_clearing_owner(
contract: Contract<Ownable2Step>,
alice: Address,
) {
contract.sender(alice).constructor(alice).unwrap();

contract
.sender(alice)
.renounce_ownership()
Expand All @@ -367,7 +369,7 @@ mod tests {
}

#[motsu::test]
fn prevents_non_owners_from_renouncing(
fn renounce_ownership_reverts_when_not_owner(
contract: Contract<Ownable2Step>,
alice: Address,
bob: Address,
Expand All @@ -384,7 +386,7 @@ mod tests {
}

#[motsu::test]
fn cancels_transfer_on_renounce(
fn renounce_ownership_succeeds_clearing_pending_transfer(
contract: Contract<Ownable2Step>,
alice: Address,
bob: Address,
Expand All @@ -401,7 +403,7 @@ mod tests {
}

#[motsu::test]
fn allows_owner_to_cancel_transfer(
fn transfer_ownership_succeeds_canceling_transfer(
contract: Contract<Ownable2Step>,
alice: Address,
bob: Address,
Expand All @@ -418,7 +420,7 @@ mod tests {
}

#[motsu::test]
fn allows_owner_to_overwrite_transfer(
fn transfer_ownership_succeeds_overwriting_pending_owner(
contract: Contract<Ownable2Step>,
alice: Address,
bob: Address,
Expand Down
Loading
Loading