Skip to content

Commit

Permalink
fix: use coin type 330 (#23)
Browse files Browse the repository at this point in the history
  • Loading branch information
AaronCQL authored Aug 28, 2023
1 parent e08f87e commit 54d8da7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
6 changes: 5 additions & 1 deletion app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,12 +163,13 @@ import (
wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper"
)

// DO NOT change the names of these variables! They are populated by the `init` function.
// DO NOT change the names and values of these variables! They are populated by the `init` function.
// TODO: to prevent other users from changing these variables, we could probably just publish our own package like https://pkg.go.dev/github.com/cosmos/cosmos-sdk/version
var (
AccountAddressPrefix string
Name string
BondDenom string
CoinType uint32
)

// TODO: What is this?
Expand Down Expand Up @@ -261,6 +262,9 @@ func init() {
Name = config.AppName
BondDenom = config.BondDenom
AccountAddressPrefix = config.AddressPrefix
// Feather chains' coin type should follow Terra's coin type.
// WARNING: changing this value will break feather's assumptions and functionalities.
CoinType = 330

// Set default home dir for app at ~/.<Name>
userHomeDir, err := os.UserHomeDir()
Expand Down
11 changes: 5 additions & 6 deletions cmd/feather-cored/cmd/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,19 @@ import (
)

func initSDKConfig() {
// Set and seal config
// Set prefixes
accountPubKeyPrefix := app.AccountAddressPrefix + "pub"
validatorAddressPrefix := app.AccountAddressPrefix + "valoper"
validatorPubKeyPrefix := app.AccountAddressPrefix + "valoperpub"
consNodeAddressPrefix := app.AccountAddressPrefix + "valcons"
consNodePubKeyPrefix := app.AccountAddressPrefix + "valconspub"

// Set and seal config
config := sdk.GetConfig()
config.SetBech32PrefixForAccount(app.AccountAddressPrefix, accountPubKeyPrefix)
config.SetBech32PrefixForValidator(validatorAddressPrefix, validatorPubKeyPrefix)
config.SetBech32PrefixForConsensusNode(consNodeAddressPrefix, consNodePubKeyPrefix)
config.SetCoinType(app.CoinType) // Set coin type
sdk.DefaultBondDenom = app.BondDenom // Set default bond denom
config.Seal()

// Set other sdk overrides

// change the default denomination in genesis
sdk.DefaultBondDenom = app.BondDenom
}

0 comments on commit 54d8da7

Please sign in to comment.