Skip to content

Commit

Permalink
Merge pull request #187 from terra-money/fix/simulation
Browse files Browse the repository at this point in the history
fix: simulation redelegate to the same validator
  • Loading branch information
emidev98 authored May 5, 2023
2 parents a1bc98f + ff70e05 commit 5beb406
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 5beb406

Please sign in to comment.