Skip to content

Commit

Permalink
fix: handle missing vote query that return an error (#80)
Browse files Browse the repository at this point in the history
  • Loading branch information
MattKetmo committed Aug 26, 2024
1 parent 92d728b commit af51431
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions pkg/watcher/votes.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,11 @@ func (w *VotesWatcher) fetchProposalsV1(ctx context.Context, node *rpc.Node) (ma
if isInvalidArgumentError(err) {
votes[proposal.Id][validator] = false
} else if err != nil {
return votes, fmt.Errorf("failed to get validator vote for proposal %d: %w", proposal.Id, err)
votes[proposal.Id][validator] = false
log.Warn().
Str("validator", validator.Name).
Str("proposal", fmt.Sprintf("%d", proposal.Id)).
Err(err).Msg("failed to get validator vote for proposal")
} else {
vote := voteResp.GetVote()
voted := false
Expand Down Expand Up @@ -173,7 +177,11 @@ func (w *VotesWatcher) fetchProposalsV1Beta1(ctx context.Context, node *rpc.Node
if isInvalidArgumentError(err) {
votes[proposal.ProposalId][validator] = false
} else if err != nil {
return votes, fmt.Errorf("failed to get validator vote for proposal %d: %w", proposal.ProposalId, err)
votes[proposal.ProposalId][validator] = false
log.Warn().
Str("validator", validator.Name).
Str("proposal", fmt.Sprintf("%d", proposal.ProposalId)).
Err(err).Msg("failed to get validator vote for proposal")
} else {
vote := voteResp.GetVote()
voted := false
Expand Down

0 comments on commit af51431

Please sign in to comment.