Skip to content
This repository has been archived by the owner on Aug 1, 2024. It is now read-only.
/ cosmos-sdk Public archive
forked from cosmos/cosmos-sdk

Commit

Permalink
fix: fix gov sims (cosmos#14969)
Browse files Browse the repository at this point in the history
  • Loading branch information
julienrbrt authored and tsenart committed Apr 12, 2023
1 parent 5de6979 commit c6284c3
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions x/gov/simulation/operations.go
Original file line number Diff line number Diff line change
Expand Up @@ -448,6 +448,10 @@ func SimulateMsgCancelProposal(ak types.AccountKeeper, bk types.BankKeeper, k *k
return simtypes.NoOpMsg(types.ModuleName, TypeMsgCancelProposal, "invalid proposer"), nil, nil
}

if (proposal.Status != v1.StatusDepositPeriod) && (proposal.Status != v1.StatusVotingPeriod) {
return simtypes.NoOpMsg(types.ModuleName, TypeMsgCancelProposal, "invalid proposal status"), nil, nil
}

account := ak.GetAccount(ctx, simAccount.Address)
spendable := bk.SpendableCoins(ctx, account.GetAddress())

Expand Down

0 comments on commit c6284c3

Please sign in to comment.