Skip to content

Commit

Permalink
Set the denom metadata for the cosmoshub in the stargate migration (#564
Browse files Browse the repository at this point in the history
)

* Set the denom metadata for the cosmoshub in the stargate migration

* Update app/migrate.go

* changelog

Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>
Co-authored-by: Federico Kunze <federico.kunze94@gmail.com>
  • Loading branch information
3 people authored and shahankhatch committed Jan 25, 2021
1 parent 8c141ed commit 79d7d1f
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
18 changes: 18 additions & 0 deletions app/migrate.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 79d7d1f

Please sign in to comment.