-
Notifications
You must be signed in to change notification settings - Fork 725
imp(transfer)!: use AddressCodec instead of Bech32 (backport #8573) #8615
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
Conversation
) * imp: added address codec to transfer * imp: address codec used in transfer * fix: tests * imp: test passing * imp: added addressCodec to PFM * imp: added receiver test * test: transfer cov * test: added cases * test: more cov * test: more cov * style: single line func def * test: new test works * imp: add basic test * imp: added migration guide * doc: added changelog * refactor: address codec moved
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## release/v10.4.x #8615 +/- ##
==================================================
Coverage ? 62.55%
==================================================
Files ? 288
Lines ? 20794
Branches ? 0
==================================================
Hits ? 13008
Misses ? 7224
Partials ? 562
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
It looked like CI was having trouble running the E2Es, so I just copied it into a separate PR to run it there: #8616 (I'll close that one once it's green) |
The lint issue would be good to get fixed tho |
fixed. |
// SetAddressCodec sets the address codec used by the keeper. | ||
func (k *Keeper) SetAddressCodec(addressCodec address.Codec) { | ||
k.addressCodec = addressCodec | ||
} | ||
|
||
// GetAddressCodec returns the address codec used by the keeper. | ||
func (k *Keeper) GetAddressCodec() address.Codec { | ||
return k.addressCodec | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you instantiate address codec in NewKeeper
with a default SDK keeper? In case they forget to call SetAddressCodec
?
I see you opted to use k.addressCodec != nil
in line. Is there a reason for this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this backport is to avoid API breaking change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think what he meant was that inside the NewKeeper function, you should set up a default address codec, so that someone not changing their app.go to include the SetAddressCodec
would not break.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah, sounds good, changed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great! Thanks 🙏
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
// SetAddressCodec sets the address codec used by the keeper. | ||
func (k *Keeper) SetAddressCodec(addressCodec address.Codec) { | ||
k.addressCodec = addressCodec | ||
} | ||
|
||
// GetAddressCodec returns the address codec used by the keeper. | ||
func (k *Keeper) GetAddressCodec() address.Codec { | ||
return k.addressCodec | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great! Thanks 🙏
Description
Backport #8573 without api breakage.
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.
docs/
) if anything is changed.godoc
comments if relevant.Files changed
in the GitHub PR explorer.