diff --git a/app/app.go b/app/app.go index 71a82b7c..46b0ccab 100644 --- a/app/app.go +++ b/app/app.go @@ -220,6 +220,12 @@ func MakeCodec() *codec.Codec { return cdc } +func SetBech32AddressPrefixes(config *sdk.Config) { + config.SetBech32PrefixForAccount(Bech32MainPrefix, Bech32MainPrefix+sdk.PrefixPublic) + config.SetBech32PrefixForValidator(Bech32MainPrefix+sdk.PrefixValidator+sdk.PrefixOperator, Bech32MainPrefix+sdk.PrefixValidator+sdk.PrefixOperator+sdk.PrefixPublic) + config.SetBech32PrefixForConsensusNode(Bech32MainPrefix+sdk.PrefixValidator+sdk.PrefixConsensus, Bech32MainPrefix+sdk.PrefixValidator+sdk.PrefixConsensus+sdk.PrefixPublic) +} + // application updates every end block func (app *App) BeginBlocker(ctx sdk.Context, req abci.RequestBeginBlock) abci.ResponseBeginBlock { // mint new tokens for the previous block diff --git a/cmd/kvcli/main.go b/cmd/kvcli/main.go index 975c9240..755cb715 100644 --- a/cmd/kvcli/main.go +++ b/cmd/kvcli/main.go @@ -54,9 +54,7 @@ func main() { // Read in the configuration file for the sdk config := sdk.GetConfig() - config.SetBech32PrefixForAccount(app.Bech32MainPrefix, app.Bech32MainPrefix+sdk.PrefixPublic) - config.SetBech32PrefixForValidator(app.Bech32MainPrefix+sdk.PrefixValidator+sdk.PrefixOperator, app.Bech32MainPrefix+sdk.PrefixValidator+sdk.PrefixOperator+sdk.PrefixPublic) - config.SetBech32PrefixForConsensusNode(app.Bech32MainPrefix+sdk.PrefixValidator+sdk.PrefixConsensus, app.Bech32MainPrefix+sdk.PrefixValidator+sdk.PrefixConsensus+sdk.PrefixPublic) + app.SetBech32AddressPrefixes(config) config.Seal() // TODO: setup keybase, viper object, etc. to be passed into diff --git a/cmd/kvd/main.go b/cmd/kvd/main.go index 520badc4..e982a8ee 100644 --- a/cmd/kvd/main.go +++ b/cmd/kvd/main.go @@ -31,9 +31,7 @@ func main() { cdc := app.MakeCodec() config := sdk.GetConfig() - config.SetBech32PrefixForAccount(app.Bech32MainPrefix, app.Bech32MainPrefix+sdk.PrefixPublic) - config.SetBech32PrefixForValidator(app.Bech32MainPrefix+sdk.PrefixValidator+sdk.PrefixOperator, app.Bech32MainPrefix+sdk.PrefixValidator+sdk.PrefixOperator+sdk.PrefixPublic) - config.SetBech32PrefixForConsensusNode(app.Bech32MainPrefix+sdk.PrefixValidator+sdk.PrefixConsensus, app.Bech32MainPrefix+sdk.PrefixValidator+sdk.PrefixConsensus+sdk.PrefixPublic) + app.SetBech32AddressPrefixes(config) config.Seal() ctx := server.NewDefaultContext()