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

Fix: unmarshalling issue with multisig keys in v0.42.x #10043

Closed
wants to merge 1 commit into from

Conversation

haasted
Copy link
Contributor

@haasted haasted commented Sep 1, 2021

Description

Closes: #10042

This fixes the issue outlined in #10042: The LegacyAminoPubKey struct fails to correctly unmarshal from JSON.


Author Checklist

All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.

I have...

  • included the correct type prefix in the PR title
  • added ! to the type prefix if API or client breaking change
  • targeted the correct branch (see PR Targeting)
  • provided a link to the relevant issue or specification
  • followed the guidelines for building modules
  • included the necessary unit and integration tests
  • added a changelog entry to CHANGELOG.md
  • included comments for documenting Go code
  • updated the relevant documentation or specification
  • reviewed "Files changed" and left comments if necessary
  • confirmed all CI checks have passed

Reviewers Checklist

All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.

I have...

  • confirmed the correct type prefix in the PR title
  • confirmed ! in the type prefix if API or client breaking change
  • confirmed all author checklist items have been addressed
  • reviewed state machine logic
  • reviewed API design and naming
  • reviewed documentation is accurate
  • reviewed tests and test coverage
  • manually tested (if applicable)

@jgimeno
Copy link
Contributor

jgimeno commented Sep 1, 2021

I have tested this on master and fails too, so it is not specific to 0.42 @aaronc @robert-zaremba @AmauryM

Copy link
Collaborator

@robert-zaremba robert-zaremba left a comment

Choose a reason for hiding this comment

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

Let's extend the test.

@@ -380,4 +381,5 @@ func TestAminoUnmarshalJSON(t *testing.T) {
err := cdc.UnmarshalJSON([]byte(pkJSON), &pk)
require.NoError(t, err)
require.Equal(t, uint32(3), pk.(*kmultisig.LegacyAminoPubKey).Threshold)
require.Equal(t, 5, len(pk.(*kmultisig.LegacyAminoPubKey).PubKeys))
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could you add a check for the content of individual keys?

@robert-zaremba
Copy link
Collaborator

Since the bug is in master we should target the PR to master and then backport it. I will update the PR target.

@robert-zaremba robert-zaremba changed the base branch from release/v0.42.x to master September 2, 2021 11:15
@robert-zaremba robert-zaremba changed the base branch from master to release/v0.42.x September 2, 2021 11:22
@robert-zaremba
Copy link
Collaborator

Retargetting doesn't work, because your PR is based on a wrong branch. Could you cherry pick your commit in a new branch based on latest master and reset the branch and change the target please?

@robert-zaremba
Copy link
Collaborator

also, you should lint the code

@haasted
Copy link
Contributor Author

haasted commented Sep 2, 2021

I have created #10061 to target the master branch.

@robert-zaremba
Copy link
Collaborator

done by #10113

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.

LegacyAminoPubKey loses keys on unmarshalling
4 participants