From f0f920cf99c5131d0371820360f9e79035700e9b Mon Sep 17 00:00:00 2001 From: yaruwang Date: Wed, 6 Oct 2021 15:20:29 +0200 Subject: [PATCH] fix: testnet cli command update genesis supply --- cmd/gaiad/cmd/testnet.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/cmd/gaiad/cmd/testnet.go b/cmd/gaiad/cmd/testnet.go index f1658838594..82e90d8889a 100644 --- a/cmd/gaiad/cmd/testnet.go +++ b/cmd/gaiad/cmd/testnet.go @@ -287,8 +287,11 @@ func initGenFiles( // set the balances in the genesis state var bankGenState banktypes.GenesisState clientCtx.Codec.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.Codec.MustMarshalJSON(&bankGenState) appGenStateJSON, err := json.MarshalIndent(appGenState, "", " ")