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

refactor: using require instead of revert where possible #107

Merged
merged 18 commits into from
Nov 18, 2024
Merged

Conversation

srdtrk
Copy link
Member

@srdtrk srdtrk commented Nov 18, 2024

Description

closes: #7


Before we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.

  • Linked to GitHub issue with discussion and accepted design, OR link to spec that describes this work.
  • Wrote unit and integration tests.
  • Added relevant natspec and godoc comments.
  • Provide a conventional commit message to follow the repository standards.
  • Re-reviewed Files changed in the GitHub PR explorer.
  • Review SonarCloud Report in the comment section below once CI passes.

@srdtrk srdtrk changed the title style: using require instead of revert where possible refactor: using require instead of revert where possible Nov 18, 2024
Copy link

codecov bot commented Nov 18, 2024

Codecov Report

Attention: Patch coverage is 25.00000% with 30 lines in your changes missing coverage. Please review.

Project coverage is 84.43%. Comparing base (2de017c) to head (0000000).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/ICS26Router.sol 12.50% 0 Missing and 14 partials ⚠️
src/utils/ICS20Lib.sol 22.22% 0 Missing and 7 partials ⚠️
src/utils/IBCStore.sol 20.00% 0 Missing and 4 partials ⚠️
src/ICS02Client.sol 0.00% 0 Missing and 3 partials ⚠️
src/ICS20Transfer.sol 83.33% 0 Missing and 1 partial ⚠️
src/utils/ICS24Host.sol 0.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##             main     #107       +/-   ##
===========================================
- Coverage   98.62%   84.43%   -14.20%     
===========================================
  Files          12       12               
  Lines         364      379       +15     
  Branches       11       67       +56     
===========================================
- Hits          359      320       -39     
- Misses          5       25       +20     
- Partials        0       34       +34     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

src/ICS26Router.sol Outdated Show resolved Hide resolved
Comment on lines -45 to +47
emit PacketCommitted(path, commitment);
commitments[path] = commitment;
emit PacketCommitted(path, commitment);
Copy link
Member Author

Choose a reason for hiding this comment

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

makes more logical sense for this to be at the end. This event should probably be removed on another issue to clean up unnecessary events

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, I added an issue for implementing spec events, and specified in that issue that we should clean up events all over the place at the same time: #108

Copy link
Contributor

@gjermundgaraba gjermundgaraba left a comment

Choose a reason for hiding this comment

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

Very nice! I very much like this syntax better. Mostly reads a lot better, which I love :D

LGTM!

@@ -80,8 +80,11 @@ jobs:
uses: ./.github/setup

- name: "Run coverage"
run: "bash scripts/checks/coverage.sh"
run: |
Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, this makes more sense

@@ -9,6 +9,7 @@
"named-parameters-mapping": "warn",
"no-console": "off",
"not-rely-on-time": "off",
"one-contract-per-file": "off"
"one-contract-per-file": "off",
"gas-custom-errors": "off"
Copy link
Contributor

Choose a reason for hiding this comment

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

I understand why this one is necessary right now, but I created an issue to re-introduce this one as soon as this is fixed in solhint: #109

@srdtrk srdtrk merged commit e638755 into main Nov 18, 2024
15 of 17 checks passed
@srdtrk srdtrk deleted the serdar/7-require branch November 18, 2024 11:35
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.

Using revert for error management
2 participants