Skip to content

Commit 6a0c96d

Browse files
author
Haifeng Xi
authored
Merge pull request #1354 from chengwenxi/validator-query
R4R: Fix bug for validator query and metrics
2 parents 75ff7ff + 3d0c33a commit 6a0c96d

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

client/stake/utils.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ func ConvertValidatorToValidatorOutput(cliCtx context.CLIContext, v stake.Valida
156156
Tokens: utils.ConvertDecToRat(v.Tokens).Mul(exRate).FloatString(),
157157
DelegatorShares: utils.ConvertDecToRat(v.DelegatorShares).Mul(exRate).FloatString(),
158158
Description: v.Description,
159-
BondHeight: v.UnbondingHeight,
159+
BondHeight: v.BondHeight,
160160
UnbondingHeight: v.UnbondingHeight,
161161
UnbondingMinTime: v.UnbondingMinTime,
162162
Commission: commission,

modules/distribution/keeper/allocation.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ func (k Keeper) AllocateTokens(ctx sdk.Context, percentVotes sdk.Dec, proposer s
6969
tokenPrecision := sdk.NewIntWithDecimal(1, 18)
7070
communityTaxAmount, err := strconv.ParseFloat(feePool.CommunityPool.AmountOf(sdk.NativeTokenMinDenom).QuoInt(tokenPrecision).String(), 64)
7171
if err == nil {
72-
k.metrics.CommunityTax.With("height", strconv.Itoa(int(ctx.BlockHeight()))).Set(communityTaxAmount)
72+
k.metrics.CommunityTax.Set(communityTaxAmount)
7373
}
7474

7575
logger.Info("Allocate reward to community tax fund", "allocate_amount", communityFunding.ToString(), "total_community_tax", feePool.CommunityPool.ToString())
@@ -96,7 +96,7 @@ func (k Keeper) AllocateFeeTax(ctx sdk.Context, destAddr sdk.AccAddress, percent
9696
tokenPrecision := sdk.NewIntWithDecimal(1, 18)
9797
communityTaxAmount, err := strconv.ParseFloat(feePool.CommunityPool.AmountOf(sdk.NativeTokenMinDenom).QuoInt(tokenPrecision).String(), 64)
9898
if err == nil {
99-
k.metrics.CommunityTax.With("height", strconv.Itoa(int(ctx.BlockHeight()))).Set(communityTaxAmount)
99+
k.metrics.CommunityTax.Set(communityTaxAmount)
100100
}
101101

102102
k.SetFeePool(ctx, feePool)

modules/distribution/keeper/metrics.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ func PrometheusMetrics(config *cfg.InstrumentationConfig) *Metrics {
2525
Subsystem: MetricsSubsystem,
2626
Name: "community_tax",
2727
Help: "community tax",
28-
}, []string{"height"}),
28+
}, []string{}),
2929
}
3030
}
3131

0 commit comments

Comments
 (0)