Skip to content

Commit

Permalink
fix: expose seat price as Near
Browse files Browse the repository at this point in the history
  • Loading branch information
MattKetmo committed Oct 19, 2023
1 parent 46913a9 commit b93777c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pkg/watcher/watcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/watcher/watcher_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit b93777c

Please sign in to comment.