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

Ownable: split assertion checks in two statements #422

Merged
merged 3 commits into from
Aug 18, 2022

Conversation

achab
Copy link
Contributor

@achab achab commented Aug 9, 2022

Fixes #421

This PR splits two checks about address in Ownable contracts in two separate with_attr statements. Currently, the error message only corresponds to the second check.

PR Checklist

  • Tests
  • Documentation
  • Changelog entry

@achab achab force-pushed the fix/split-assert-checks branch from 8367194 to 1e71146 Compare August 9, 2022 11:26
Copy link
Collaborator

@andrew-fleming andrew-fleming left a comment

Choose a reason for hiding this comment

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

Nice improvement, thank you!

@martriay
Copy link
Contributor

martriay commented Aug 10, 2022

Thanks for this improvement, it is now clear that we're not properly testing for the non owner case, just the zero address special case. We do have a test on ERC721SafeMintableMock, not on the library tests.

Could you add the missing tests?

@achab achab force-pushed the fix/split-assert-checks branch from 8fc99f8 to ced7018 Compare August 11, 2022 23:42
@achab achab force-pushed the fix/split-assert-checks branch from ced7018 to 036c5cf Compare August 12, 2022 00:27
@achab
Copy link
Contributor Author

achab commented Aug 12, 2022

Hi there, thanks for the review! I've just added a small test to check that it reverts if the function protected_function is called by an account different from the owner.

Copy link
Contributor

@martriay martriay left a comment

Choose a reason for hiding this comment

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

Looks good! Thanks :)

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

Successfully merging this pull request may close these issues.

Ownable: split assertion checks in two statements
3 participants