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

chore: add migration for sdk.IntProto -> sdkmath.Int (TotalEscrowForDenom) #7767

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

damiannolan
Copy link
Member

Description

Adds a migration for sdk.IntProto (protobuf encoding) used in TotalEscrowForDenom to use sdkmath.Int (binary encoding) directly.

NOTE It could be possible to migrate this state entry to collections and use AltValueCodec as mentioned in #7699.

closes: #7699


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/).
  • Added relevant godoc comments.
  • Provide a conventional commit message to follow the repository standards.
  • Include a descriptive changelog entry when appropriate. This may be left to the discretion of the PR reviewers. (e.g. chores should be omitted from changelog)
  • Re-reviewed Files changed in the GitHub PR explorer.
  • Review SonarCloud Report in the comment section below once CI passes.

@damiannolan
Copy link
Member Author

Requires dependency updates to readd IntProto in sdk.

func() {
// set total escrow for denoms amounts in store using legacy IntProto encoding
store := suite.chainA.GetSimApp().TransferKeeper.KVStoreService.OpenKVStore(suite.chainA.GetContext())
key := transfertypes.TotalEscrowForDenomKey("ibc/EB7094899ACFB7A6F2A67DB084DEE2E9A83DEFAA5DEF92D9A9814FFD9FF673FA")
Copy link
Member Author

Choose a reason for hiding this comment

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

Should test with more key entries than this one. This was just to get the test up and running and prove the migration was successful.

I can try to add some more cases :)

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.

Migration path for math.IntProto to math.Int (breaking)
1 participant