-
Notifications
You must be signed in to change notification settings - Fork 547
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(templates): Set and seal SDK global config in
app/config.go
(
#4199) * refactor(templates): Set and seal SDK global config in `app/config.go` * updates
- Loading branch information
1 parent
967df1b
commit dbbe52e
Showing
5 changed files
with
20 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package app | ||
|
||
import sdk "github.com/cosmos/cosmos-sdk/types" | ||
|
||
func init() { | ||
// Set prefixes | ||
accountPubKeyPrefix := AccountAddressPrefix + "pub" | ||
validatorAddressPrefix := AccountAddressPrefix + "valoper" | ||
validatorPubKeyPrefix := AccountAddressPrefix + "valoperpub" | ||
consNodeAddressPrefix := AccountAddressPrefix + "valcons" | ||
consNodePubKeyPrefix := AccountAddressPrefix + "valconspub" | ||
|
||
// Set and seal config | ||
config := sdk.GetConfig() | ||
config.SetBech32PrefixForAccount(AccountAddressPrefix, accountPubKeyPrefix) | ||
config.SetBech32PrefixForValidator(validatorAddressPrefix, validatorPubKeyPrefix) | ||
config.SetBech32PrefixForConsensusNode(consNodeAddressPrefix, consNodePubKeyPrefix) | ||
config.Seal() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters