(t *testing.T)
| 122 | } |
| 123 | |
| 124 | func TestCalculateBlocksDiff_Cap14400(t *testing.T) { |
| 125 | params := defaultTestParams() |
| 126 | params.EpochBlocksBackoffPercent = 50 // 50%, base = 1.5 |
| 127 | |
| 128 | // steps=20 → floor(10 * 1.5^20) = floor(33252.5...) → capped at 14400 |
| 129 | result := calculateBlocksDiff(params, 9300) |
| 130 | require.Equal(t, int64(14400), result) |
| 131 | } |
| 132 | |
| 133 | func TestCalculateBlocksDiff_NoOverflowPanic(t *testing.T) { |
| 134 | // Ensure no panic with extreme parameters that would cause |
nothing calls this directly
no test coverage detected