Add Safety Measures to Coin/Coins (#2797)
This commit is contained in:
committed by
Jae Kwon
parent
47eed3958b
commit
41fc538ac7
@@ -279,10 +279,12 @@ func CollectStdTxs(cdc *codec.Codec, moniker string, genTxsDir string, genDoc tm
|
||||
func NewDefaultGenesisAccount(addr sdk.AccAddress) GenesisAccount {
|
||||
accAuth := auth.NewBaseAccountWithAddress(addr)
|
||||
coins := sdk.Coins{
|
||||
{"fooToken", sdk.NewInt(1000)},
|
||||
{bondDenom, freeFermionsAcc},
|
||||
sdk.NewCoin("fooToken", sdk.NewInt(1000)),
|
||||
sdk.NewCoin(bondDenom, freeFermionsAcc),
|
||||
}
|
||||
|
||||
coins.Sort()
|
||||
|
||||
accAuth.Coins = coins
|
||||
return NewGenesisAccount(&accAuth)
|
||||
}
|
||||
|
||||
@@ -63,7 +63,7 @@ func appStateFn(r *rand.Rand, accs []simulation.Account) json.RawMessage {
|
||||
|
||||
// Randomly generate some genesis accounts
|
||||
for _, acc := range accs {
|
||||
coins := sdk.Coins{sdk.Coin{stakeTypes.DefaultBondDenom, sdk.NewInt(amount)}}
|
||||
coins := sdk.Coins{sdk.NewCoin(stakeTypes.DefaultBondDenom, sdk.NewInt(amount))}
|
||||
genesisAccounts = append(genesisAccounts, GenesisAccount{
|
||||
Address: acc.Address,
|
||||
Coins: coins,
|
||||
|
||||
Reference in New Issue
Block a user