From c01b8253b3ef42c39c02aa20be032a86e7fdadd6 Mon Sep 17 00:00:00 2001 From: Sai Kumar <17549398+gsk967@users.noreply.github.com> Date: Thu, 21 Apr 2022 19:14:34 +0530 Subject: [PATCH] fix(tests): fix simulations on cancel unbond (#11712) --- x/staking/simulation/operations.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/x/staking/simulation/operations.go b/x/staking/simulation/operations.go index 257588d7603d..7cff6459db18 100644 --- a/x/staking/simulation/operations.go +++ b/x/staking/simulation/operations.go @@ -419,10 +419,7 @@ func SimulateMsgCancelUnbondingDelegate(ak types.AccountKeeper, bk types.BankKee return simtypes.NoOpMsg(types.ModuleName, types.TypeMsgCancelUnbondingDelegation, "delegator receiving balance is negative"), nil, nil } - cancelBondAmt, err := simtypes.RandPositiveInt(r, unbondingDelegationEntry.Balance) - if err != nil { - return simtypes.NoOpMsg(types.ModuleName, types.TypeMsgCancelUnbondingDelegation, "invalid cancelBondAmt amount"), nil, err - } + cancelBondAmt := simtypes.RandomAmount(r, unbondingDelegationEntry.Balance) if cancelBondAmt.IsZero() { return simtypes.NoOpMsg(types.ModuleName, types.TypeMsgCancelUnbondingDelegation, "cancelBondAmt amount is zero"), nil, nil