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

changed bench32prefixes, gaiacli keys parse command still use cosmos … #5092

Merged
merged 8 commits into from
Nov 6, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ correct version via: `pkgutil --pkg-info=com.apple.pkg.CLTools_Executables`.

### Improvements

* (client/keys) [\#5091](https://github.com/cosmos/cosmos-sdk/issues/5091) Changed prefixes using `SetBech32PrefixForAccount(),SetBech32PrefixForValidator(),SetBech32PrefixForConsensusNode()`method, but `gaiacli keys parse` command still use `cosmos`prefix.
elvin-du marked this conversation as resolved.
Show resolved Hide resolved
* (modules) [\#5017](https://github.com/cosmos/cosmos-sdk/pull/5017) The `x/auth` package now supports
generalized genesis accounts through the `GenesisAccount` interface.
* (modules) [\#4762](https://github.com/cosmos/cosmos-sdk/issues/4762) Deprecate remove and add permissions in ModuleAccount.
Expand Down
20 changes: 12 additions & 8 deletions client/keys/parse.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,17 @@ import (
sdk "github.com/cosmos/cosmos-sdk/types"
)

var config = sdk.GetConfig()
var bech32Prefixes = []string{
config.GetBech32AccountAddrPrefix(),
config.GetBech32AccountPubPrefix(),
config.GetBech32ValidatorAddrPrefix(),
config.GetBech32ValidatorPubPrefix(),
config.GetBech32ConsensusAddrPrefix(),
config.GetBech32ConsensusPubPrefix(),
func bech32Prefixes()[]string{
elvin-du marked this conversation as resolved.
Show resolved Hide resolved
var config = sdk.GetConfig()
elvin-du marked this conversation as resolved.
Show resolved Hide resolved

return []string{
config.GetBech32AccountAddrPrefix(),
config.GetBech32AccountPubPrefix(),
config.GetBech32ValidatorAddrPrefix(),
config.GetBech32ValidatorPubPrefix(),
config.GetBech32ConsensusAddrPrefix(),
config.GetBech32ConsensusPubPrefix(),
}
}

type hexOutput struct {
Expand All @@ -45,6 +48,7 @@ type bech32Output struct {
}

func newBech32Output(bs []byte) bech32Output {
bech32Prefixes := bech32Prefixes()
out := bech32Output{Formats: make([]string, len(bech32Prefixes))}
for i, prefix := range bech32Prefixes {
bech32Addr, err := bech32.ConvertAndEncode(prefix, bs)
Expand Down