-
Notifications
You must be signed in to change notification settings - Fork 115
/
prefix.go
22 lines (19 loc) · 959 Bytes
/
prefix.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
package app
import sdk "github.com/cosmos/cosmos-sdk/types"
// Bech32 prefixes
var (
AccountAddressPrefix = "axelar"
AccountPubKeyPrefix = AccountAddressPrefix + sdk.PrefixPublic
ValidatorAddressPrefix = AccountAddressPrefix + sdk.PrefixValidator + sdk.PrefixOperator
ValidatorPubKeyPrefix = AccountAddressPrefix + sdk.PrefixValidator + sdk.PrefixOperator + sdk.PrefixPublic
ConsNodeAddressPrefix = AccountAddressPrefix + sdk.PrefixValidator + sdk.PrefixConsensus
ConsNodePubKeyPrefix = AccountAddressPrefix + sdk.PrefixValidator + sdk.PrefixConsensus + sdk.PrefixPublic
)
// SetConfig sets the prefix config for the bech32 encoding
func SetConfig() {
config := sdk.GetConfig()
config.SetBech32PrefixForAccount(AccountAddressPrefix, AccountPubKeyPrefix)
config.SetBech32PrefixForValidator(ValidatorAddressPrefix, ValidatorPubKeyPrefix)
config.SetBech32PrefixForConsensusNode(ConsNodeAddressPrefix, ConsNodePubKeyPrefix)
config.Seal()
}