Skip to content

Refactor global sdk.Config  #7448

Closed
Closed

Description

Summary

Remove global bech32 prefixes and the rest of the global config before v1.0 (see #7421).

Problem Definition

Global config variables are generally a bad design decision. And in interchain world having more flexibility around bech32 prefixes is probably desirable.

If we are targeting a v1.0 release at some point, we likely want to remove the global Config and do something better that allows us to keep the core SDK minimal, well-designed and the other parts modular.

#7242 likely brings us closer to being able to do this because address parsing is now happening inside handlers rather than at the encoding level.

Proposal

See initial proposal

In #7242, addresses are now parsed manually using sdk.AccAddressFromBech32, etc. Instead we can either pass the parameters into keepers (like we do for codecs) or attach them to sdk.Context and maybe decode address using ctx.AccAddressFromBech32 in keepers and handlers.

Also we may consider removing ValAddress and ConsAddress from types/ as they are specific to x/staking.


For Admin Use

  • Not duplicate issue
  • Appropriate labels applied
  • Appropriate contributors tagged
  • Contributor assigned/self-assigned
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Type

No type

Projects

  • Status

    🥳 Done

Relationships

None yet

Development

No branches or pull requests

Issue actions