diff --git a/CHANGELOG.md b/CHANGELOG.md index acf8d317f3b..4544f9f6856 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -36,6 +36,10 @@ Ref: https://keepachangelog.com/en/1.0.0/ ## [Unreleased] +### Improvements + +* (app) [\#564](https://github.com/cosmos/gaia/pull/564) Add client denomination metadata for atoms. + ### Bug Fixes * (cmd) [\#563](https://github.com/cosmos/gaia/pull/563) Add balance coin to supply when adding a new genesis account diff --git a/app/migrate.go b/app/migrate.go index 9b5f197ef58..00dd0fa50c6 100644 --- a/app/migrate.go +++ b/app/migrate.go @@ -130,6 +130,24 @@ $ %s migrate /path/to/genesis.json --chain-id=cosmoshub-4 --genesis-time=2019-04 } + var bankGenesis bank.GenesisState + + clientCtx.JSONMarshaler.MustUnmarshalJSON(newGenState[bank.ModuleName], &bankGenesis) + + bankGenesis.DenomMetadata = []bank.Metadata{ + { + Description: "The native staking token of the Cosmos Hub.", + DenomUnits: []*bank.DenomUnit{ + {Denom: "uatom", Exponent: uint32(0), Aliases: []string{"microatom"}}, + {Denom: "matom", Exponent: uint32(3), Aliases: []string{"milliatom"}}, + {Denom: "atom", Exponent: uint32(6), Aliases: []string{}}, + }, + Base: "uatom", + Display: "atom", + }, + } + newGenState[bank.ModuleName] = clientCtx.JSONMarshaler.MustMarshalJSON(&bankGenesis) + var stakingGenesis staking.GenesisState clientCtx.JSONMarshaler.MustUnmarshalJSON(newGenState[staking.ModuleName], &stakingGenesis)