From 4275814c8ad469adfba9cdd23f255532fdc1e228 Mon Sep 17 00:00:00 2001 From: Csaba Kiraly Date: Wed, 22 Nov 2023 14:22:56 +0100 Subject: [PATCH] testerasure: fix 3D test Signed-off-by: Csaba Kiraly --- tests/codex/testerasure.nim | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/tests/codex/testerasure.nim b/tests/codex/testerasure.nim index 703a2d29..38387fc0 100644 --- a/tests/codex/testerasure.nim +++ b/tests/codex/testerasure.nim @@ -324,10 +324,10 @@ asyncchecksuite "Erasure encode/decode": i1 = 1 k2 = 5 m2 = 2 - i2 = k1 + m1 + i2 = i1 * (k1 + m1) k3 = 3 - m3 = 1 - i3 = i1 * (k2 + m2) + m3 = 2 + i3 = i2 * (k2 + m2) let encoded1 = await encode(k1, m1, i1) @@ -353,9 +353,12 @@ asyncchecksuite "Erasure encode/decode": decoded.treeCid == encoded1.originalTreeCid decoded.blocksCount == encoded1.originalBlocksCount + # Checking after decoding one layer. for d in dropped: - let present = await store.hasBlock(manifest.treeCid, d) - check present.tryGet() + if not encoded3.isParity(d) and not encoded3.isPadding(d): # Parity blocks are not restored + let present = await store.hasBlock(encoded2.treeCid, encoded3.oldIndex(d)) + echo present + check present.tryGet() test "3D encode: test multi-dimensional API": const