Skip to content

Commit

Permalink
fix(simulator): balance must be gte two
Browse files Browse the repository at this point in the history
  • Loading branch information
fmorency committed Jul 9, 2024
1 parent 99307bf commit 5bea544
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions simulation/operations.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,8 @@ func SimulateMsgCreateValidator(txGen client.TxConfig, k keeper.Keeper) simtypes
}

balance := k.GetBankKeeper().GetBalance(ctx, simAccount.Address, denom)
if !balance.IsPositive() || balance.IsZero() {
return simtypes.NoOpMsg(poatypes.ModuleName, msgType, "balance is negative or zero"), nil, nil
if balance.Amount.LT(sdkmath.NewInt(2)) {
return simtypes.NoOpMsg(poatypes.ModuleName, msgType, "balance is less than two"), nil, nil
}

// Generate a random self-delegation amount between 1 and balance
Expand Down

0 comments on commit 5bea544

Please sign in to comment.