Skip to content

Commit

Permalink
fix: fix vote metrics when proposal is passed (#49)
Browse files Browse the repository at this point in the history
  • Loading branch information
MattKetmo authored Dec 19, 2023
1 parent 2956a5b commit 2262ad9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pkg/watcher/votes_v1.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ func (w *VotesV1Watcher) fetchProposals(ctx context.Context, node *rpc.Node) err
ProposalId: proposal.Id,
Voter: voter,
})

w.metrics.Vote.Reset()
if isInvalidArgumentError(err) {
w.handleVote(chainID, validator, proposal.Id, nil)
} else if err != nil {
Expand Down
2 changes: 2 additions & 0 deletions pkg/watcher/votes_v1beta1.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ func (w *VotesV1Beta1Watcher) fetchProposals(ctx context.Context, node *rpc.Node
ProposalId: proposal.ProposalId,
Voter: voter,
})

w.metrics.Vote.Reset()
if isInvalidArgumentError(err) {
w.handleVote(chainID, validator, proposal.ProposalId, nil)
} else if err != nil {
Expand Down

0 comments on commit 2262ad9

Please sign in to comment.