Skip to content

Commit

Permalink
fix: simulation redelegate to same validator
Browse files Browse the repository at this point in the history
  • Loading branch information
emidev98 committed May 4, 2023
1 parent 3742bab commit ff70e05
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions x/alliance/tests/simulation/operations.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit ff70e05

Please sign in to comment.