Skip to content

Commit f666199

Browse files
authored
test(ledger): remove unused window calculation (#1029)
Signed-off-by: Chris Gianelloni <wolf31o2@blinklabs.io>
1 parent 74d8465 commit f666199

File tree

1 file changed

+0
-25
lines changed

1 file changed

+0
-25
lines changed

ledger/state_test.go

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff 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-
}

0 commit comments

Comments
 (0)