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

remove string error messages #13

Merged
merged 2 commits into from
Sep 13, 2023
Merged

remove string error messages #13

merged 2 commits into from
Sep 13, 2023

Conversation

3esmit
Copy link

@3esmit 3esmit commented Sep 12, 2023

Description

Fixes #11

Checklist

Ensure you completed all of the steps below before submitting your pull request:

  • Added natspec comments?
  • Ran forge snapshot?
  • Ran pnpm lint?
  • Ran forge test?

Copy link
Collaborator

@0x-r4bbit 0x-r4bbit left a comment

Choose a reason for hiding this comment

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

Thank you for adding the snapshot's before/after states!

I think we should use this opportunity and also introduce tests that ensure these new errors are indeed thrown. While the tests had been ported, they didn't have tons of coverage.
Otherwise this PR would probably not make it through CI.

If you want to see how tests for errors can be written, check out all the tests here that are prefixed with test_RevertWhen_*:

https://github.com/status-im/communities-contracts/pull/2/files#diff-0c1702f33e161b30e89a441837d1623bb2d4cc9ff781ce300cda4f3e82ab4aa0R74-R84

Lastly, I think these commits need to be rebased on top of latest master because they still have a commit with the lint fixes that have already landed in master. That's probably also the reason there's a merge commit in this pull request.

Great work otherwise!

@0x-r4bbit
Copy link
Collaborator

Another thing I've just noticed: the added natspec comments checkbox is checked, but I don't see any added comments for that.

I don't think it's a big deal in this case, and I'd say checking that checkbox is optional, depending on context.
If we however introduce new contracts/functions, we should definitely add comments (and tests)

@3esmit 3esmit merged commit c8581cd into master Sep 13, 2023
6 checks passed
@3esmit 3esmit deleted the no-error-strings branch September 26, 2023 16:06
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.

Use custom errors instead of strings
2 participants