You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Verify that only the DEFAULT_ADMIN_ROLE has the ability to manage roles.
Ensure the DEFAULT_ADMIN_ROLE cannot transfer ownership unintentionally.
Test Provider Role:
Verify that the PROVIDER_ROLE can call the addScores(date, ids, cids) and getScore functions.
Ensure that the PROVIDER_ROLE can update IPFS data for community tokens and user scores.
Confirm that the PROVIDER_ROLE cannot grant or revoke roles.
Verify that the PROVIDER_ROLE cannot be granted or revoked by anyone other than the DEFAULT_ADMIN_ROLE.
Minting Functionality
Test Minting Conditions:
Ensure that a community member can mint a token if they haven't minted one before.
Verify that the token count increases by 1 after each mint.
Confirm that tokenBalance[tokenId] is set to +1 after minting.
Ensure that minting reverts if a community member tries to mint more than one token per community.
Verify that minting reverts if the token ID does not exist.
Test Token ID Mapping:
Verify that minting reverts if the community member has already minted a token.
Confirm that minting reverts if the token ID does not exist or is invalid.
Token Issuance
Test Issue Function:
Ensure the community manager can issue a new token for the community.
Verify that issuing a token updates the token mapping correctly.
Confirm that the new token can be minted by community members.
Ensure that issuing reverts if the token already exists.
Score Management
Test getScore Function:
Verify that the getScore function is public and can be called by anyone.
Ensure that the function returns the correct scores for a given token ID.
Confirm that the function handles non-existent token IDs gracefully.
Ensure that the function reverts if the token ID is not found.
Ensure that the function reverts if the account balance is 0.
Check that the string formatting returned by the function is correct.
Test addScores Function:
Confirm that only the PROVIDER_ROLE can call the addScores(date, ids, cids) function.
Verify that the function updates the CIDs correctly.
Ensure that the function can handle multiple token IDs and CIDs.
Confirm that CIDs are correctly stored and retrievable from IPFS.
Test Structure
To follow a standard testing process and accommodate upgradable contracts and role changes, we break down the test cases into sub-descriptions (Success and Revert) and start all test cases with Should.
This structure ensures comprehensive test coverage for the upgradable contract and role functionalities, including minting, issuing tokens, and score management.
The text was updated successfully, but these errors were encountered:
Test Cases
Role Management
Test Admin Role:
DEFAULT_ADMIN_ROLE
can grant roles.DEFAULT_ADMIN_ROLE
can revoke roles.DEFAULT_ADMIN_ROLE
has the ability to manage roles.DEFAULT_ADMIN_ROLE
cannot transfer ownership unintentionally.Test Provider Role:
PROVIDER_ROLE
can call theaddScores(date, ids, cids)
andgetScore
functions.PROVIDER_ROLE
can update IPFS data for community tokens and user scores.PROVIDER_ROLE
cannot grant or revoke roles.PROVIDER_ROLE
cannot be granted or revoked by anyone other than theDEFAULT_ADMIN_ROLE
.Minting Functionality
Test Minting Conditions:
tokenBalance[tokenId]
is set to +1 after minting.Test Token ID Mapping:
Token Issuance
Score Management
Test
getScore
Function:getScore
function is public and can be called by anyone.Test
addScores
Function:PROVIDER_ROLE
can call theaddScores(date, ids, cids)
function.Test Structure
To follow a standard testing process and accommodate upgradable contracts and role changes, we break down the test cases into sub-descriptions (
Success
andRevert
) and start all test cases withShould
.This structure ensures comprehensive test coverage for the upgradable contract and role functionalities, including minting, issuing tokens, and score management.
The text was updated successfully, but these errors were encountered: