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

refactor(runtime): define address codec providers in runtime #17037

Merged
merged 11 commits into from
Jul 18, 2023
Merged
Prev Previous commit
Next Next commit
updates
  • Loading branch information
julienrbrt committed Jul 18, 2023
commit 30f56a24c1a428b1c03750333aa9f383a3c3833e
8 changes: 2 additions & 6 deletions runtime/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -285,12 +285,8 @@ func ProvideAddressCodec(in AddressCodecInputs) (address.Codec, ValidatorAddress
return in.AddressCodecFactory(), in.ValidatorAddressCodecFactory(), in.ConsensusAddressCodecFactory()
}

if in.AuthConfig == nil {
panic("auth and staking config cannot both be nil if no custom address codec is provided")
}

if in.AuthConfig.Bech32Prefix == "" {
panic("auth bech32 prefix cannot be empty if no custom address codec is provided")
if in.AuthConfig == nil || in.AuthConfig.Bech32Prefix == "" {
panic("auth config bech32 prefix cannot be empty if no custom address codec is provided")
}

if in.StakingConfig == nil {
Expand Down