From ff70e0515c9fc1b26193fa81921ab1e3faccebab Mon Sep 17 00:00:00 2001 From: emidev98 Date: Thu, 4 May 2023 11:02:38 +0200 Subject: [PATCH] fix: simulation redelegate to same validator --- x/alliance/tests/simulation/operations.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/x/alliance/tests/simulation/operations.go b/x/alliance/tests/simulation/operations.go index 125ccee1..ea70a2b3 100644 --- a/x/alliance/tests/simulation/operations.go +++ b/x/alliance/tests/simulation/operations.go @@ -144,6 +144,10 @@ func SimulateMsgRedelegate(cdc *codec.ProtoCodec, ak types.AccountKeeper, bk typ idx = simtypes.RandIntBetween(r, 0, len(validators)-1) validatorToDelegateTo := validators[idx] + if delegation.ValidatorAddress == validatorToDelegateTo.GetOperator().String() { + return simtypes.NoOpMsg(types.ModuleName, types.MsgRedelegateType, "redelegation to the same validator"), nil, nil + } + msg := &types.MsgRedelegate{ DelegatorAddress: delegation.DelegatorAddress, ValidatorSrcAddress: delegation.ValidatorAddress,