Skip to content

Commit

Permalink
Added the possibility of specifying custom genesis accounts and balan…
Browse files Browse the repository at this point in the history
…ces inside CLI tests (#8936)

Co-authored-by: Amaury <[email protected]>
  • Loading branch information
RiccardoM and amaury1093 authored Mar 19, 2021
1 parent c9ef428 commit 129267c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions testutil/network/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,14 +168,14 @@ func initGenFiles(cfg Config, genAccounts []authtypes.GenesisAccount, genBalance
return err
}

authGenState.Accounts = accounts
authGenState.Accounts = append(authGenState.Accounts, accounts...)
cfg.GenesisState[authtypes.ModuleName] = cfg.Codec.MustMarshalJSON(&authGenState)

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

bankGenState.Balances = genBalances
bankGenState.Balances = append(bankGenState.Balances, genBalances...)
cfg.GenesisState[banktypes.ModuleName] = cfg.Codec.MustMarshalJSON(&bankGenState)

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

0 comments on commit 129267c

Please sign in to comment.