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: use RegisterAminoMsg to register Amino encodings #1187

Merged
merged 2 commits into from
Jun 30, 2023

Conversation

dadamu
Copy link
Contributor

@dadamu dadamu commented Jun 30, 2023

Description

This PR replaces legacy amino registration of msgs into RegisterAminoMsg in order to avoid the bug that a registered Msg name that is too long when signing on ledger Nano device. See:
cosmos/cosmos-sdk#10870


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)

@dadamu dadamu requested a review from a team as a code owner June 30, 2023 09:48
@github-actions github-actions bot added x/profiles Module that allows to create and manage decentralized social profiles x/subspaces Issue on the x/subspaces module x/relationships labels Jun 30, 2023
Comment on lines -28 to +32
cdc.Amino.RegisterConcrete(&MsgRequestPostOwnerTransfer{}, "desmos/MsgRequestPostOwnerTransfer", nil)
cdc.Amino.RegisterConcrete(&MsgCancelPostOwnerTransferRequest{}, "desmos/MsgCancelPostOwnerTransferRequest", nil)
cdc.Amino.RegisterConcrete(&MsgAcceptPostOwnerTransferRequest{}, "desmos/MsgAcceptPostOwnerTransferRequest", nil)
cdc.Amino.RegisterConcrete(&MsgRefusePostOwnerTransferRequest{}, "desmos/MsgRefusePostOwnerTransferRequest", nil)
legacy.RegisterAminoMsg(cdc, &MsgRequestPostOwnerTransfer{}, "desmos/MsgRequestPostOwnerTransfer")
legacy.RegisterAminoMsg(cdc, &MsgCancelPostOwnerTransferRequest{}, "desmos/MsgCancelPostOwnerTransfer")
legacy.RegisterAminoMsg(cdc, &MsgAcceptPostOwnerTransferRequest{}, "desmos/MsgAcceptPostOwnerTransfer")
legacy.RegisterAminoMsg(cdc, &MsgRefusePostOwnerTransferRequest{}, "desmos/MsgRefusePostOwnerTransfer")
Copy link
Contributor Author

@dadamu dadamu Jun 30, 2023

Choose a reason for hiding this comment

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

amino name of OwnerTransferRequest msg are too long, so remove Request from them

@codecov
Copy link

codecov bot commented Jun 30, 2023

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (c368dc1) 80.80% compared to head (03ff088) 80.80%.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1187   +/-   ##
=======================================
  Coverage   80.80%   80.80%           
=======================================
  Files         194      194           
  Lines       17310    17310           
=======================================
  Hits        13987    13987           
  Misses       2727     2727           
  Partials      596      596           
Impacted Files Coverage Δ
x/profiles/types/codec.go 100.00% <100.00%> (ø)
x/reactions/types/codec.go 51.35% <100.00%> (ø)
x/relationships/types/codec.go 100.00% <100.00%> (ø)
x/reports/types/codec.go 58.13% <100.00%> (ø)
x/subspaces/types/codec.go 58.66% <100.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

Copy link
Contributor

@RiccardoM RiccardoM left a comment

Choose a reason for hiding this comment

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

Great discovery 💯

@RiccardoM RiccardoM changed the title chore: using RegisterAminoMsg for msgs instead refactor: using RegisterAminoMsg for msgs instead Jun 30, 2023
@RiccardoM RiccardoM changed the title refactor: using RegisterAminoMsg for msgs instead refactor: use RegisterAminoMsg to register Amino encodings Jun 30, 2023
@RiccardoM RiccardoM merged commit 6a228c0 into master Jun 30, 2023
@RiccardoM RiccardoM deleted the paul/using-amino-msg-in-cdc branch June 30, 2023 13:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
x/profiles Module that allows to create and manage decentralized social profiles x/relationships x/subspaces Issue on the x/subspaces module
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants