Skip to content

Commit

Permalink
Merge pull request #60 from provenance-io/enhancement/coin-metadata-c…
Browse files Browse the repository at this point in the history
…onfig-for-nhash

Add provenance denom metadata to testnet
  • Loading branch information
channa-figure authored Feb 10, 2021
2 parents 0d21c7b + 1479fa9 commit f8954b1
Showing 1 changed file with 23 additions and 3 deletions.
26 changes: 23 additions & 3 deletions cmd/provenanced/cmd/testnet.go
Original file line number Diff line number Diff line change
Expand Up @@ -305,16 +305,36 @@ func initGenFiles(
authGenState.Accounts = accounts
appGenState[authtypes.ModuleName] = clientCtx.JSONMarshaler.MustMarshalJSON(&authGenState)

// PROVENANCE SPECIFIC CONFIG
// ----------------------------------------

// set the balances in the genesis state
var bankGenState banktypes.GenesisState
clientCtx.JSONMarshaler.MustUnmarshalJSON(appGenState[banktypes.ModuleName], &bankGenState)

bankGenState.Balances = genBalances
nhashDenomUnit := banktypes.DenomUnit{
Exponent: 0,
Denom: "nhash",
Aliases: []string{"nanohash"},
}
hashDenomUnit := banktypes.DenomUnit{
Exponent: 9,
Denom: "hash",
}
denomUnits := []*banktypes.DenomUnit{
&hashDenomUnit,
&nhashDenomUnit,
}
denomMetadata := banktypes.Metadata{
Description: "The native staking token of the Provenance Blockchain.",
Display: "hash",
Base: "nhash",
DenomUnits: denomUnits,
}
bankGenState.DenomMetadata = []banktypes.Metadata{denomMetadata}
appGenState[banktypes.ModuleName] = clientCtx.JSONMarshaler.MustMarshalJSON(&bankGenState)

// PROVENANCE SPECIFIC CONFIG
// ----------------------------------------

// Set the staking denom
var stakeGenState stakingtypes.GenesisState
clientCtx.JSONMarshaler.MustUnmarshalJSON(appGenState[stakingtypes.ModuleName], &stakeGenState)
Expand Down

0 comments on commit f8954b1

Please sign in to comment.