Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Contract Test case Definition #7

Open
21 tasks done
mehdi-torabiv opened this issue Jun 3, 2024 · 1 comment
Open
21 tasks done

Contract Test case Definition #7

mehdi-torabiv opened this issue Jun 3, 2024 · 1 comment

Comments

@mehdi-torabiv
Copy link
Contributor

mehdi-torabiv commented Jun 3, 2024

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

@cyri113
Copy link
Contributor

cyri113 commented Jun 3, 2024

@mehdi-torabiv

I think we need 2 new mappings: mintedAt and burnedAt.

  • What new test cases does this add? and where?
  • How does this impact the getScore revert test case?

Missing test cases for issue(string memory cid).

This was referenced Jun 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants