diff --git a/tests/codex/testerasure.nim b/tests/codex/testerasure.nim index 78b10dddc..5d8726288 100644 --- a/tests/codex/testerasure.nim +++ b/tests/codex/testerasure.nim @@ -10,6 +10,7 @@ import pkg/codex/manifest import pkg/codex/stores import pkg/codex/blocktype as bt import pkg/codex/rng +import pkg/codex/utils import ./helpers @@ -51,7 +52,7 @@ asyncchecksuite "Erasure encode/decode": check: encoded.len mod (buffers + parity) == 0 - encoded.rounded == (manifest.len + (buffers - (manifest.len mod buffers))) + encoded.rounded == roundUp(manifest.len, buffers) encoded.steps == encoded.rounded div buffers return encoded @@ -64,13 +65,13 @@ asyncchecksuite "Erasure encode/decode": let encoded = await encode(buffers, parity) var - column = rng.rand((encoded.len - 1) div encoded.steps) # random column - dropped: seq[Cid] + column = rng.rand((encoded.len div encoded.steps) - 1) # random column + dropped: seq[(int, Cid)] for _ in 0..