Skip to content

Commit

Permalink
fix: testnet cli command update genesis supply
Browse files Browse the repository at this point in the history
  • Loading branch information
yaruwang committed Sep 30, 2021
1 parent 8b42d52 commit d5133e5
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions cmd/gaiad/cmd/testnet.go
Original file line number Diff line number Diff line change
Expand Up @@ -287,8 +287,11 @@ func initGenFiles(
// set the balances in the genesis state
var bankGenState banktypes.GenesisState
clientCtx.JSONMarshaler.MustUnmarshalJSON(appGenState[banktypes.ModuleName], &bankGenState)

bankGenState.Balances = genBalances

bankGenState.Balances = banktypes.SanitizeGenesisBalances(genBalances)
for _, bal := range bankGenState.Balances {
bankGenState.Supply = bankGenState.Supply.Add(bal.Coins...)
}
appGenState[banktypes.ModuleName] = clientCtx.JSONMarshaler.MustMarshalJSON(&bankGenState)

appGenStateJSON, err := json.MarshalIndent(appGenState, "", " ")
Expand Down

0 comments on commit d5133e5

Please sign in to comment.