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

IBC: panic on GetSignBytes and remove SubModuleCdc #7645

Merged
merged 5 commits into from
Oct 23, 2020

Conversation

colin-axner
Copy link
Contributor

@colin-axner colin-axner commented Oct 23, 2020

Description

ref: #7638


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.
  • Wrote unit and integration tests
  • Updated relevant documentation (docs/) or specification (x/<module>/spec/)
  • Added relevant godoc comments.
  • Added a relevant changelog entry to the Unreleased section in CHANGELOG.md
  • Re-reviewed Files changed in the Github PR explorer
  • Review Codecov Report in the comment section below once CI passes

@colin-axner colin-axner changed the title panic on GetSignBytes and remove SubModuleCdc where possible IBC: panic on GetSignBytes and remove SubModuleCdc Oct 23, 2020
@codecov
Copy link

codecov bot commented Oct 23, 2020

Codecov Report

Merging #7645 into master will decrease coverage by 0.01%.
The diff coverage is 0.00%.

@@            Coverage Diff             @@
##           master    #7645      +/-   ##
==========================================
- Coverage   54.15%   54.14%   -0.02%     
==========================================
  Files         611      611              
  Lines       38556    38556              
==========================================
- Hits        20881    20877       -4     
- Misses      15543    15547       +4     
  Partials     2132     2132              

func (msg MsgTransfer) GetSignBytes() []byte {
return sdk.MustSortJSON(ModuleCdc.MustMarshalJSON(&msg))
panic("IBC messages do not support amino")
Copy link
Collaborator

Choose a reason for hiding this comment

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

q: why not return nil bytes? the tx will fail regardless

Copy link
Contributor Author

@colin-axner colin-axner Oct 23, 2020

Choose a reason for hiding this comment

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

What if someone tries to use this function in an application module? Returning nil could be a silent failure. Also going off this comment

Copy link
Member

Choose a reason for hiding this comment

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

I guess the logic for panic is that it will clearly communicate why it's failing whereas in Jack's issue he thought it should work.

func (msg MsgCreateClient) GetSignBytes() []byte {
return sdk.MustSortJSON(SubModuleCdc.MustMarshalJSON(&msg))
panic("IBC messages do not support amino")
Copy link
Collaborator

Choose a reason for hiding this comment

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

ditto

@fedekunze fedekunze added the A:automerge Automatically merge PR once all prerequisites pass. label Oct 23, 2020
@mergify mergify bot merged commit e4378e7 into master Oct 23, 2020
@mergify mergify bot deleted the colin/panic-get-sign-bytes branch October 23, 2020 17:14
clevinson pushed a commit that referenced this pull request Oct 29, 2020
* panic on GetSignBytes and remove SubModuleCdc where possible

* fix build

Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A:automerge Automatically merge PR once all prerequisites pass.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants