Skip to content

Commit

Permalink
add err handling
Browse files Browse the repository at this point in the history
  • Loading branch information
tuantran1702 committed May 9, 2024
1 parent 0415482 commit a737df0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion x/group/keeper/msg_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -631,7 +631,10 @@ func (k Keeper) SubmitProposal(ctx context.Context, msg *group.MsgSubmitProposal
if msg.Exec == group.Exec_EXEC_TRY {
// Consider proposers as Yes votes
for _, proposer := range msg.Proposers {
k.GasService.GasMeter(ctx).Consume(gasCostPerIteration, "vote on proposal")
err = k.GasService.GasMeter(ctx).Consume(gasCostPerIteration, "vote on proposal")
if err != nil {
return &group.MsgSubmitProposalResponse{ProposalId: id}, errorsmod.Wrap(err, "the proposal was created but failed on gas consumption for vote")
}
_, err = k.Vote(ctx, &group.MsgVote{
ProposalId: id,
Voter: proposer,
Expand Down

0 comments on commit a737df0

Please sign in to comment.