Skip to content

Commit

Permalink
Fix gov spam filter
Browse files Browse the repository at this point in the history
  • Loading branch information
Reecepbcups committed Apr 28, 2023
1 parent 9e7f3f5 commit f8e1309
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions app/decorators/gov_filter.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,12 @@ func (gpsd GovPreventSpamDecorator) checkSpamSubmitProposalMsg(ctx sdk.Context,
validMsg := func(m sdk.Msg) error {
if msg, ok := m.(*govv1.MsgSubmitProposal); ok {
// prevent spam gov msg
depositParams := gpsd.govKeeper.GetDepositParams(ctx)
depositParams := gpsd.govKeeper.GetParams(ctx)
miniumInitialDeposit := gpsd.calcMiniumInitialDeposit(depositParams.MinDeposit)
if msg.InitialDeposit.IsAllLT(miniumInitialDeposit) {
return errorsmod.Wrapf(sdkerrors.ErrUnauthorized, "not enough initial deposit. required: %v", miniumInitialDeposit)
for _, coin := range msg.InitialDeposit {
if coin.Amount.LT(miniumInitialDeposit.AmountOf(coin.Denom)) {
return errorsmod.Wrapf(sdkerrors.ErrUnauthorized, "not enough initial deposit. required: %v", miniumInitialDeposit)
}
}
}
return nil
Expand Down

0 comments on commit f8e1309

Please sign in to comment.