--- Security tests ---
(t *testing.T)
| 181 | // --- Security tests --- |
| 182 | |
| 183 | func TestCalculateBlocksDiff_CRZero(t *testing.T) { |
| 184 | // CR=0 means maximum steps. Must not panic, should cap at 14400. |
| 185 | params := defaultTestParams() |
| 186 | |
| 187 | require.NotPanics(t, func() { |
| 188 | result := calculateBlocksDiff(params, 0) |
| 189 | // steps = (9500-0)/10 = 950, 1.1^950 is astronomical → capped |
| 190 | require.Equal(t, int64(14400), result) |
| 191 | }) |
| 192 | } |
| 193 | |
| 194 | func TestCalculateBlocksDiff_MaxSteps(t *testing.T) { |
| 195 | // Wide threshold gap: warn=10000, halt=0 |
nothing calls this directly
no test coverage detected