Test cases
Below are the test cases for the engagement contract.
variables
uint private _counter; // increment on issue function
mapping(uint id, uint) private _tokenCount; // nb of accounts that have minted a token
deployment
Success
issue(string memory tokenCid)
Creates a new token and adds a cid to it's metadata.
Success
mint(uint id, string memory account)
Mint a token balance to 1.
Success
Revert
burn(uint id, string memory account)
Burn the token balance to 0.
Success
Revert
getScore(uint date, uint id, string memory account)
Return a formatted uri: ipfs://hash/id/account.json
Success
Revert
updateScores(uint date, string memory cid)
Update the cid for a given date.
Success
Revert
uri(uint id)
Return a formatted uri: ipfs://hash.json
Success
Revert
Test cases
Below are the test cases for the engagement contract.
variables
deployment
Success
PROVIDER_ROLE#9issue(string memory tokenCid)
Creates a new token and adds a cid to it's metadata.
Success
mint(uint id, string memory account)
Mint a token balance to 1.
Success
Revert
burn(uint id, string memory account)
Burn the token balance to 0.
Success
Revert
getScore(uint date, uint id, string memory account)
Return a formatted uri:
ipfs://hash/id/account.jsonSuccess
Revert
updateScores(uint date, string memory cid)
Update the cid for a given date.
Success
Revert
PROVIDER_ROLE) #34uri(uint id)
Return a formatted uri:
ipfs://hash.jsonSuccess
Revert