Skip to content
This repository has been archived by the owner on Jan 2, 2025. It is now read-only.

Commit

Permalink
fix duplicate metrics without moniker (#84)
Browse files Browse the repository at this point in the history
  • Loading branch information
kerto07 authored Dec 5, 2024
1 parent 56fe0ea commit 0b64f44
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion td2/validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,16 @@ func (cc *ChainConfig) GetValInfo(first bool) (err error) {
// Fetch info from /cosmos.staking.v1beta1.Query/Validator
// it's easier to ask people to provide valoper since it's readily available on
// explorers, so make it easy and lookup the consensus key for them.
cc.valInfo.Conspub, cc.valInfo.Moniker, cc.valInfo.Jailed, cc.valInfo.Bonded, err = getVal(ctx, cc.client, cc.ValAddress)
conspub, moniker, jailed, bonded, err := getVal(ctx, cc.client, cc.ValAddress)
if err != nil {
return
}

cc.valInfo.Conspub = conspub
cc.valInfo.Moniker = moniker
cc.valInfo.Jailed = jailed
cc.valInfo.Bonded = bonded

if first && cc.valInfo.Bonded {
l(fmt.Sprintf("⚙️ found %s (%s) in validator set", cc.ValAddress, cc.valInfo.Moniker))
} else if first && !cc.valInfo.Bonded {
Expand Down

0 comments on commit 0b64f44

Please sign in to comment.