mirror of
https://github.com/codex-storage/nim-codex.git
synced 2025-01-21 02:09:19 +00:00
erasure: fix test calculation
Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
This commit is contained in:
parent
05933c6ebd
commit
7c2263f028
@ -57,14 +57,14 @@ asyncchecksuite "Erasure encode/decode":
|
|||||||
let encoded = await encode(buffers, parity)
|
let encoded = await encode(buffers, parity)
|
||||||
|
|
||||||
var
|
var
|
||||||
column = rng.rand((encoded.blocksCount - 1) div encoded.interleave) # random column
|
column = rng.rand(encoded.interleave - 1) # random column
|
||||||
dropped: seq[int]
|
dropped: seq[int]
|
||||||
|
|
||||||
for _ in 0..<encoded.ecM:
|
for _ in 0..<encoded.ecM:
|
||||||
dropped.add(column)
|
dropped.add(column)
|
||||||
(await store.delBlock(encoded.treeCid, column)).tryGet()
|
(await store.delBlock(encoded.treeCid, column)).tryGet()
|
||||||
(await store.delBlock(manifest.treeCid, column)).tryGet()
|
(await store.delBlock(manifest.treeCid, column)).tryGet()
|
||||||
column.inc(encoded.interleave - 1)
|
column.inc(encoded.interleave)
|
||||||
|
|
||||||
var
|
var
|
||||||
decoded = (await erasure.decode(encoded)).tryGet()
|
decoded = (await erasure.decode(encoded)).tryGet()
|
||||||
@ -87,7 +87,7 @@ asyncchecksuite "Erasure encode/decode":
|
|||||||
let encoded = await encode(buffers, parity)
|
let encoded = await encode(buffers, parity)
|
||||||
|
|
||||||
var
|
var
|
||||||
column = rng.rand((encoded.blocksCount - 1) div encoded.interleave) # random column
|
column = rng.rand(encoded.interleave - 1) # random column
|
||||||
dropped: seq[int]
|
dropped: seq[int]
|
||||||
|
|
||||||
for _ in 0..<encoded.ecM + 1:
|
for _ in 0..<encoded.ecM + 1:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user