File tree Expand file tree Collapse file tree 1 file changed +0
-25
lines changed Expand file tree Collapse file tree 1 file changed +0
-25
lines changed Original file line number Diff line number Diff line change @@ -18,7 +18,6 @@ import (
1818 "fmt"
1919 "io"
2020 "log/slog"
21- "math/big"
2221 "strings"
2322 "testing"
2423
@@ -695,27 +694,3 @@ func TestCalculateStabilityWindow_LargeValues(t *testing.T) {
695694 t .Errorf ("expected stability window %d, got %d" , expectedWindow , result )
696695 }
697696}
698-
699- // Helper function to calculate expected window using big.Rat for precision
700- func calculateExpectedWindow (k int , activeSlotsCoeff float64 ) uint64 {
701- // Convert activeSlotsCoeff to big.Rat
702- rat := new (big.Rat ).SetFloat64 (activeSlotsCoeff )
703-
704- // Calculate 3*k
705- numerator := new (big.Int ).SetInt64 (int64 (3 * k ))
706-
707- // Multiply by denominator of activeSlotsCoeff
708- numerator .Mul (numerator , rat .Denom ())
709-
710- // Divide by numerator of activeSlotsCoeff
711- quotient , remainder := new (
712- big.Int ,
713- ).QuoRem (numerator , rat .Num (), new (big.Int ))
714-
715- // Round up if there's a remainder
716- if remainder .Sign () != 0 {
717- quotient .Add (quotient , big .NewInt (1 ))
718- }
719-
720- return quotient .Uint64 ()
721- }
You can’t perform that action at this time.
0 commit comments