Skip to content

chore(modules/transfer): Replace deprecated usage of AddressFromBech32 with address.Codec#7845

Closed
hungdinh82 wants to merge 6 commits intocosmos:mainfrom
hungdinh82:chore1
Closed

chore(modules/transfer): Replace deprecated usage of AddressFromBech32 with address.Codec#7845
hungdinh82 wants to merge 6 commits intocosmos:mainfrom
hungdinh82:chore1

Conversation

@hungdinh82
Copy link
Contributor

Description

closes: #7835


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.

Comment on lines +352 to +354
addrCdc := addresscodec.NewBech32Codec(sdk.GetConfig().GetBech32AccountAddrPrefix())
senderBytes, err := addrCdc.StringToBytes(data.Sender)
sender := sdk.AccAddress(senderBytes)
Copy link
Contributor

Choose a reason for hiding this comment

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

the keeper should probably have an address codec as a field

Comment on lines 162 to 164
addrCdc := addresscodec.NewBech32Codec(cosmosChain.Config().Bech32Prefix)
senderBytes, err := addrCdc.StringToBytes(user.FormattedAddress())
sender := sdk.AccAddress(senderBytes)
Copy link
Contributor

@technicallyty technicallyty Jan 21, 2025

Choose a reason for hiding this comment

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

probably should be a method on the E2ETestSuite type to avoid repeating this on L282-L289

@gjermundgaraba
Copy link
Contributor

Hi @hungdinh82, I think we will just do this in the team because we are working on a timeline where we need to get things sorted rather quickly, but I appreciate the effort you've put into this.

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.

Replace deprecated usage of AddressFromBech32 with address.Codec

3 participants