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

imp: return error on default branch of ack type switch statement #5791

Merged
merged 2 commits into from
Feb 1, 2024

Conversation

crodriguezvega
Copy link
Contributor

Description

The only item of #65 that still applies for ibc-go:

In OnAcknowledgementPacket, the default branch of a switch statement is used for success logic. This is bit risky to maintain if additional error codes get added in the future (in the ICS it simply says if (!ack.success)). Rather, all error and success cases for the ack.Response should be handled explicitly and the default should be an error.

closes: #65

Commit Message / Changelog Entry

type: commit message

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 the 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 Report

Attention: 2 lines in your changes are missing coverage. Please review.

Comparison is base (dbc11b5) 81.61% compared to head (2987201) 81.60%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #5791      +/-   ##
==========================================
- Coverage   81.61%   81.60%   -0.02%     
==========================================
  Files         199      199              
  Lines       15146    15148       +2     
==========================================
  Hits        12362    12362              
- Misses       2319     2321       +2     
  Partials      465      465              
Files Coverage Δ
modules/apps/transfer/keeper/relay.go 90.28% <60.00%> (-0.66%) ⬇️

Copy link
Contributor

@DimitrisJim DimitrisJim left a comment

Choose a reason for hiding this comment

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

looks sensible to me! do note that the Ack's ValidateBasic also guards against creation of a wacky response field.

@crodriguezvega crodriguezvega merged commit 8e4f966 into main Feb 1, 2024
66 checks passed
@crodriguezvega crodriguezvega deleted the carlos/65-error-on-default-branch-ack-type branch February 1, 2024 18:56
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.

ICS20 Inconsistencies with spec and improvements to code
4 participants