From c2d0315823913ff46f78a3371050fb9c9d5521cd Mon Sep 17 00:00:00 2001 From: Edgar Aroutiounian Date: Tue, 3 Dec 2019 00:32:15 -0800 Subject: [PATCH] [reward] log whatPercentStakedNow --- internal/chain/reward.go | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/internal/chain/reward.go b/internal/chain/reward.go index 4a17c265f..b3625e595 100644 --- a/internal/chain/reward.go +++ b/internal/chain/reward.go @@ -148,6 +148,8 @@ func whatPercentStakedNow( return nil, err } + dole := numeric.NewDecFromBigInt(soFarDoledOut) + for i := range active { wrapper, err := beaconchain.ReadValidatorInformation(active[i]) if err != nil { @@ -159,9 +161,12 @@ func whatPercentStakedNow( } percentage := stakedNow.Quo(totalTokens.Mul( reward.PercentageForTimeStamp(timestamp), - ).Add( - numeric.NewDecFromBigInt(soFarDoledOut)), - ) + ).Add(dole)) + utils.Logger().Info(). + Str("so-far-doled-out", dole.String()). + Str("staked-percentage", percentage.String()). + Str("currently-staked", stakedNow.String()). + Msg("Computed how much staked right now") return &percentage, nil }