Skip to content

Commit

Permalink
Stop executing the handler when proposal is sumbmitted (#534)
Browse files Browse the repository at this point in the history
## Describe your changes and provide context


## Testing performed to validate your change

CI will test it

Co-authored-by: cordt-sei <[email protected]>
  • Loading branch information
Wojciech Małota-Wójcik and cordt-sei authored Aug 23, 2024
1 parent a1d14b1 commit 3395ce7
Showing 1 changed file with 0 additions and 9 deletions.
9 changes: 0 additions & 9 deletions x/gov/keeper/proposal.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,6 @@ func (keeper Keeper) SubmitProposalWithExpedite(ctx sdk.Context, content types.C
return types.Proposal{}, sdkerrors.Wrap(types.ErrNoProposalHandlerExists, content.ProposalRoute())
}

// Execute the proposal content in a new context branch (with branched store)
// to validate the actual parameter changes before the proposal proceeds
// through the governance process. State is not persisted.
cacheCtx, _ := ctx.CacheContext()
handler := keeper.router.GetRoute(content.ProposalRoute())
if err := handler(cacheCtx, content); err != nil {
return types.Proposal{}, sdkerrors.Wrap(types.ErrInvalidProposalContent, err.Error())
}

proposalID, err := keeper.GetProposalID(ctx)
if err != nil {
return types.Proposal{}, err
Expand Down

0 comments on commit 3395ce7

Please sign in to comment.