diff --git a/pkg/watcher/watcher.go b/pkg/watcher/watcher.go index ce32993..f227242 100644 --- a/pkg/watcher/watcher.go +++ b/pkg/watcher/watcher.go @@ -163,7 +163,7 @@ func (w *Watcher) collectValidators(ctx context.Context) (near.ValidatorsRespons w.metrics.ValidatorSlashed.WithLabelValues(labels...).Set(metrics.BoolToFloat64(v.IsSlashed)) w.metrics.ValidatorStake.WithLabelValues(labels...).Set(v.Stake.Div(yoctoUnit).InexactFloat64()) - t := v.Stake.InexactFloat64() + t := v.Stake.Div(yoctoUnit).InexactFloat64() if seatPrice == 0 { seatPrice = t } diff --git a/pkg/watcher/watcher_test.go b/pkg/watcher/watcher_test.go index aae2af6..e0a248e 100644 --- a/pkg/watcher/watcher_test.go +++ b/pkg/watcher/watcher_test.go @@ -306,7 +306,7 @@ func TestWatcher(t *testing.T) { require.NoError(t, err) assert.Equal(t, float64(142256359), testutil.ToFloat64(metrics.EpochStartHeight)) - assert.Equal(t, float64(5048850744401447176504014136424), testutil.ToFloat64(metrics.SeatPrice)) + assert.Equal(t, float64(5048850.744401447176504014136424), testutil.ToFloat64(metrics.SeatPrice)) // ValidatorRank assert.Equal(t, 5, testutil.CollectAndCount(metrics.ValidatorRank))