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

Function TestCalculateBlocksDiff_CRZero

x/bme/keeper/keeper_test.go:183–192  ·  view source on GitHub ↗

--- Security tests ---

(t *testing.T)

Source from the content-addressed store, hash-verified

181// --- Security tests ---
182
183func 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
194func TestCalculateBlocksDiff_MaxSteps(t *testing.T) {
195 // Wide threshold gap: warn=10000, halt=0

Callers

nothing calls this directly

Calls 2

defaultTestParamsFunction · 0.85
calculateBlocksDiffFunction · 0.85

Tested by

no test coverage detected