From 07e5d4f0a2cee63b65d38ee271c585d50cdbc526 Mon Sep 17 00:00:00 2001 From: insumity Date: Thu, 8 Feb 2024 11:46:23 +0100 Subject: [PATCH] add logging mesages --- x/ccv/provider/keeper/hooks.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/x/ccv/provider/keeper/hooks.go b/x/ccv/provider/keeper/hooks.go index 4dbc0b1f79..dda60e766f 100644 --- a/x/ccv/provider/keeper/hooks.go +++ b/x/ccv/provider/keeper/hooks.go @@ -185,6 +185,10 @@ func (h Hooks) AfterProposalVote(ctx sdk.Context, proposalID uint64, voterAddr s consAddr, err := validator.GetConsAddr() if err != nil { + h.k.Logger(ctx).Error("could not extract validator's consensus address", + "error", err.Error(), + "validator acc addr", voterAddr, + ) return } @@ -195,6 +199,10 @@ func (h Hooks) AfterProposalVote(ctx sdk.Context, proposalID uint64, voterAddr s vote, found := h.k.govKeeper.GetVote(ctx, proposalID, voterAddr) if !found { + h.k.Logger(ctx).Error("could not find vote for validator", + "validator acc addr", voterAddr, + "proposalID", proposalID, + ) return } @@ -202,6 +210,10 @@ func (h Hooks) AfterProposalVote(ctx sdk.Context, proposalID uint64, voterAddr s // only consider votes that vote YES with 100% weight weight, err := sdk.NewDecFromStr(vote.Options[0].Weight) if err != nil { + h.k.Logger(ctx).Error("could not extract decimal value from vote's weight", + "vote", vote, + "error", err.Error(), + ) return } if !weight.Equal(math.LegacyNewDec(1)) {