From 2262ad93ed1b0af58649049a7334149e1d99e769 Mon Sep 17 00:00:00 2001 From: Matt Ketmo Date: Tue, 19 Dec 2023 16:45:36 +0100 Subject: [PATCH] fix: fix vote metrics when proposal is passed (#49) --- pkg/watcher/votes_v1.go | 2 ++ pkg/watcher/votes_v1beta1.go | 2 ++ 2 files changed, 4 insertions(+) diff --git a/pkg/watcher/votes_v1.go b/pkg/watcher/votes_v1.go index c42f62b..ef7a73e 100644 --- a/pkg/watcher/votes_v1.go +++ b/pkg/watcher/votes_v1.go @@ -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 { diff --git a/pkg/watcher/votes_v1beta1.go b/pkg/watcher/votes_v1beta1.go index a7deb7d..441be35 100644 --- a/pkg/watcher/votes_v1beta1.go +++ b/pkg/watcher/votes_v1beta1.go @@ -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 {