@@ -60,13 +60,9 @@ func TestCalculateEffectiveRate_SubTiB_HitsMinimum(t *testing.T) {
6060 chain .EpochsPerMonth ,
6161 )
6262
63- // At the minimum floor, ratePerMonth is derived from ratePerEpoch × epm so the
64- // two fields are consistent. ratePerMonth is therefore slightly less than
65- // MinimumPricePerMonth by at most (epm-1) attoUSDFC due to integer truncation.
66- wantMonthly := new (big.Int ).Mul (rate .RatePerEpoch , big .NewInt (chain .EpochsPerMonth ))
67- if rate .RatePerMonth .Cmp (wantMonthly ) != 0 {
68- t .Errorf ("ratePerMonth should equal ratePerEpoch*epm at minimum: got %s, want %s" ,
69- rate .RatePerMonth , wantMonthly )
63+ if rate .RatePerMonth .Cmp (pricing .MinimumPricePerMonth ) != 0 {
64+ t .Errorf ("ratePerMonth should equal MinimumPricePerMonth: got %s, want %s" ,
65+ rate .RatePerMonth , pricing .MinimumPricePerMonth )
7066 }
7167 if rate .RatePerEpoch .Cmp (bi (1 )) < 0 {
7268 t .Errorf ("ratePerEpoch should be at least 1: got %s" , rate .RatePerEpoch )
@@ -99,11 +95,9 @@ func TestCalculateEffectiveRate_ZeroSize(t *testing.T) {
9995 chain .EpochsPerMonth ,
10096 )
10197
102- // Zero size hits the minimum floor; ratePerMonth must equal ratePerEpoch × epm.
103- wantMonthly := new (big.Int ).Mul (rate .RatePerEpoch , big .NewInt (chain .EpochsPerMonth ))
104- if rate .RatePerMonth .Cmp (wantMonthly ) != 0 {
105- t .Errorf ("ratePerMonth should be epoch-aligned for zero size: got %s, want %s" ,
106- rate .RatePerMonth , wantMonthly )
98+ if rate .RatePerMonth .Cmp (pricing .MinimumPricePerMonth ) != 0 {
99+ t .Errorf ("ratePerMonth should equal MinimumPricePerMonth for zero size: got %s, want %s" ,
100+ rate .RatePerMonth , pricing .MinimumPricePerMonth )
107101 }
108102}
109103
@@ -673,11 +667,11 @@ func TestDepositNeeded_ZeroTotalLockup(t *testing.T) {
673667// --- CalculateEffectiveRate edge cases ---
674668
675669func TestCalculateEffectiveRate_NilInputs (t * testing.T ) {
676- rate := CalculateEffectiveRate (bi ( chain . TiB ) , nil , nil , 0 )
670+ rate := CalculateEffectiveRate (nil , nil , nil , 0 )
677671 if rate .RatePerEpoch == nil || rate .RatePerMonth == nil {
678672 t .Fatal ("nil rate fields returned" )
679673 }
680- // nil price and nil minRate both treated as 0; ratePerEpoch is clamped to bigOne=1
674+ // nil size, price, and minRate are treated as 0; ratePerEpoch is clamped to bigOne=1.
681675 if rate .RatePerEpoch .Cmp (big .NewInt (1 )) != 0 {
682676 t .Errorf ("RatePerEpoch = %s, want 1" , rate .RatePerEpoch )
683677 }
0 commit comments