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

GMS-1616: Additional erc1155 unit tests #226

Merged
merged 6 commits into from
Jun 12, 2024
Merged

Conversation

bruno-imx
Copy link
Contributor

No description provided.

@bruno-imx bruno-imx requested a review from a team as a code owner June 6, 2024 03:18
drinkcoffee
drinkcoffee previously approved these changes Jun 6, 2024
Copy link

openzeppelin-code bot commented Jun 6, 2024

GMS-1616: Additional erc1155 unit tests

Generated at commit: 810df71b38a25671bdad80161718a6243798a3b4

🚨 Report Summary

Severity Level Results
Contracts Critical
High
Medium
Low
Note
Total
2
1
0
11
27
41
Dependencies Critical
High
Medium
Low
Note
Total
0
0
0
0
0
0

For more details view the full report in OpenZeppelin Code Inspector

Copy link
Contributor

@valzam valzam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just left a comment, if no concern, approved

@@ -129,6 +157,10 @@ contract ImmutableERC1155Test is Test {
assertEq(immutableERC1155.baseURI(), "test-base-uri");
}

function test_DeploymentShouldSetUri() public {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How is this test different from line 134?

Copy link
Contributor Author

@bruno-imx bruno-imx Jun 12, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is one of those cases of 'you optimize what you measure'.
The forge unit test coverage tool requires a unit test to deploy the contract in order to 'mark' that bit of code as 'tested'

So this is a unit test that deploys the contract and checks that the constructor is correct - in this case, it seems like a big workaround & unnecessary

This unit test validates the uri(uint256 index) function that invokes baseURI() - ignoring the index

@bruno-imx bruno-imx merged commit 1ddb3dd into main Jun 12, 2024
6 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants