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

Modify all message constructors to take in a string for address #108

Merged
merged 2 commits into from
Apr 12, 2021

Conversation

colin-axner
Copy link
Contributor

@colin-axner colin-axner commented Apr 8, 2021

Description

closes: #73


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

All NewMsg() functions take in the signer as a string. This prevents bugs from happening at the level of the caller since String relies on external context
Copy link
Member

@AdityaSripal AdityaSripal left a comment

Choose a reason for hiding this comment

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

Looks great, clean fix!

)

var (
signer = "cosmos1ckgw5d7jfj7wwxjzs9fdrdev9vc8dzcw3n2lht"
Copy link
Member

Choose a reason for hiding this comment

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

Is there a way to test in the testing package that this new feature will help with switching out bech32 prefixes?

Copy link
Contributor Author

@colin-axner colin-axner Apr 12, 2021

Choose a reason for hiding this comment

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

Yes and no. We could switch out the configs bech32 prefix like how the relayer does, but this would just be testing .String() function.

.String() relies on the bech32 prefix set in the config. It is up to the caller of .String() to ensure the config has the set the correct bech32 prefix. This pr just removes ibc-go from calling .String() and enforces the caller to have control over when .String() is called, which will hopefully lead the caller to avoid bugs and/or debug the issue easier

We cannot prevent the caller from setting the config incorrectly and passing in the wrong string

@colin-axner colin-axner merged commit d5cc991 into main Apr 12, 2021
@colin-axner colin-axner deleted the colin/73-string-in-newmsg branch April 12, 2021 10:01
faddat referenced this pull request in notional-labs/ibc-go Mar 1, 2022
CosmosCar pushed a commit to caelus-labs/ibc-go that referenced this pull request Nov 6, 2023
Bumps [github.com/ipfs/go-log](https://github.com/ipfs/go-log) from 1.0.4 to 1.0.5.
- [Release notes](https://github.com/ipfs/go-log/releases)
- [Commits](ipfs/go-log@v1.0.4...v1.0.5)

---
updated-dependencies:
- dependency-name: github.com/ipfs/go-log
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

use string for address in NewMsg constructors
2 participants