MCPcopy Create free account
hub / github.com/akash-network/node / TestCalculateBlocksDiff_SmallBackoff

Function TestCalculateBlocksDiff_SmallBackoff

x/bme/keeper/keeper_test.go:168–179  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

166}
167
168func 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

Callers

nothing calls this directly

Calls 2

defaultTestParamsFunction · 0.85
calculateBlocksDiffFunction · 0.85

Tested by

no test coverage detected