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

Change all references to sdkerrors to new errorsmod and ibcerrors #3186

Merged
merged 10 commits into from
Feb 27, 2023

Conversation

chatton
Copy link
Contributor

@chatton chatton commented Feb 22, 2023

Description

closes: #2896

This PR changes all occurences of sdkerrors.Wrap/Wrapf to errorsmod.Wrap/Wrapf and all refersnces to default sdk errors to use ibcerrors which were added in #3184.

Commit Message / Changelog Entry

chore: Migrated all sdk errors to the new errors go module.

see the guidelines for commit messages. (view raw markdown for examples)


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.

  • Targeted PR against correct branch (see CONTRIBUTING.md).
  • Linked to Github issue with discussion and accepted design OR link to spec that describes this work.
  • Code follows the module structure standards and Go style guide.
  • Wrote unit and integration tests.
  • Updated relevant documentation (docs/) or specification (x/<module>/spec/).
  • Added relevant godoc comments.
  • Provide a commit message to be used for the changelog entry in the PR description for review.
  • Re-reviewed Files changed in the Github PR explorer.
  • Review Codecov Report in the comment section below once CI passes.

@codecov-commenter
Copy link

codecov-commenter commented Feb 22, 2023

Codecov Report

Merging #3186 (c14339a) into main (761277a) will increase coverage by 0.00%.
The diff coverage is 73.07%.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #3186   +/-   ##
=======================================
  Coverage   78.60%   78.60%           
=======================================
  Files         177      177           
  Lines       12410    12420   +10     
=======================================
+ Hits         9755     9763    +8     
- Misses       2230     2231    +1     
- Partials      425      426    +1     
Impacted Files Coverage Δ
...27-interchain-accounts/controller/keeper/keeper.go 89.65% <0.00%> (ø)
...nterchain-accounts/controller/keeper/msg_server.go 91.89% <0.00%> (ø)
modules/core/02-client/migrations/v7/genesis.go 77.27% <0.00%> (ø)
modules/core/02-client/migrations/v7/store.go 68.85% <0.00%> (ø)
...ght-clients/07-tendermint/migrations/migrations.go 75.00% <0.00%> (ø)
modules/core/keeper/msg_server.go 55.17% <17.28%> (ø)
...les/light-clients/07-tendermint/proposal_handle.go 79.66% <20.00%> (ø)
modules/core/23-commitment/types/merkle.go 68.60% <34.78%> (ø)
...7-interchain-accounts/controller/keeper/account.go 80.85% <40.00%> (ø)
modules/light-clients/07-tendermint/update.go 87.50% <40.00%> (ø)
... and 79 more

Base automatically changed from cian/issue#2896-migrate-error-packages to main February 22, 2023 12:07
Copy link
Contributor Author

@chatton chatton left a comment

Choose a reason for hiding this comment

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

There were two linting errors that were also resolved here, I highlighted them as they are difficult to pick out in a diff like this.

}

if !isAllowedAddress(ctx, msgTransfer.Receiver, allocation.AllowList) {
return authz.AcceptResponse{}, sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "not allowed address for transfer")
return authz.AcceptResponse{}, errorsmod.Wrap(ibcerrors.ErrInvalidAddress, "not allowed address for transfer")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

note: Wrapf was changed to Wrap as there was one argument being passed

}

found := make(map[string]bool, 0)
for i := 0; i < len(allocation.AllowList); i++ {
if found[allocation.AllowList[i]] {
return sdkerrors.Wrapf(ErrInvalidAuthorization, "duplicate entry in allow list %s")
return errorsmod.Wrapf(ErrInvalidAuthorization, "duplicate entry in allow list %s", allocation.AllowList[i])
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Wrapf was being used but no arg was being passed. I've now passed the duplicate entry.

Copy link
Member

@damiannolan damiannolan 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 to me! 🙏

Copy link
Contributor

@colin-axner colin-axner left a comment

Choose a reason for hiding this comment

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

Fabulous work @chatton! 🐎

@chatton chatton merged commit a24a6c6 into main Feb 27, 2023
@chatton chatton deleted the cian/issue#2896-use-new-errors branch February 27, 2023 12:55
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.

migrate error packages
4 participants