(t *testing.T)
| 166 | } |
| 167 | |
| 168 | func TestCalculateBlocksDiff_SmallBackoff(t *testing.T) { |
| 169 | // EpochBlocksBackoffPercent=1 (1%), base = 1.01 |
| 170 | params := defaultTestParams() |
| 171 | params.EpochBlocksBackoffPercent = 1 |
| 172 | |
| 173 | // steps=1 → floor(10 * 1.01) = 10 |
| 174 | require.Equal(t, int64(10), calculateBlocksDiff(params, 9490)) |
| 175 | // steps=10 → floor(10 * 1.01^10) = floor(11.046) = 11 |
| 176 | require.Equal(t, int64(11), calculateBlocksDiff(params, 9400)) |
| 177 | // steps=50 → floor(10 * 1.01^50) = floor(16.446) = 16 |
| 178 | require.Equal(t, int64(16), calculateBlocksDiff(params, 9000)) |
| 179 | } |
| 180 | |
| 181 | // --- Security tests --- |
| 182 |
nothing calls this directly
no test coverage detected