(t *testing.T)
| 131 | } |
| 132 | |
| 133 | func TestCalculateBlocksDiff_NoOverflowPanic(t *testing.T) { |
| 134 | // Ensure no panic with extreme parameters that would cause |
| 135 | // int64 overflow if not for the Dec cap. |
| 136 | params := defaultTestParams() |
| 137 | params.EpochBlocksBackoffPercent = 100 // 100%, base = 2.0 |
| 138 | |
| 139 | // steps=50 → 2^50 * 10 = ~1.13 * 10^16, well beyond int64 |
| 140 | // Should not panic, should return 14400 |
| 141 | require.NotPanics(t, func() { |
| 142 | result := calculateBlocksDiff(params, 9000) |
| 143 | require.Equal(t, int64(14400), result) |
| 144 | }) |
| 145 | } |
| 146 | |
| 147 | func TestCalculateBlocksDiff_BelowHaltThreshold(t *testing.T) { |
| 148 | // CR below halt threshold is still valid input—calculateBlocksDiff |
nothing calls this directly
no test coverage detected