From cda04486114559af1a823b1814d406c0fdf33b14 Mon Sep 17 00:00:00 2001 From: gmega Date: Fri, 21 Jun 2024 17:37:53 -0300 Subject: [PATCH] check for both strategies in attribute inheritance test --- tests/codex/testmanifest.nim | 32 ++++++++++++++++++++------------ 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/tests/codex/testmanifest.nim b/tests/codex/testmanifest.nim index fc74d817..3393fa08 100644 --- a/tests/codex/testmanifest.nim +++ b/tests/codex/testmanifest.nim @@ -77,25 +77,33 @@ checksuite "Manifest": suite "Manifest - Attribute Inheritance": - let - base = Manifest.new( - treeCid = Cid.example, - blockSize = 1.MiBs, - datasetSize = 100.MiBs - ) - protected = Manifest.new( - manifest = base, + proc makeProtectedManifest(strategy: StrategyType): Manifest = + Manifest.new( + manifest = Manifest.new( + treeCid = Cid.example, + blockSize = 1.MiBs, + datasetSize = 100.MiBs, + ), treeCid = Cid.example, datasetSize = 200.MiBs, ecK = 1, ecM = 1, - strategy = SteppedStrategy + strategy = strategy ) - verifiable = Manifest.new( - manifest = protected, + + test "Should preserve interleaving strategy for protected manifest in verifiable manifest": + var verifiable = Manifest.new( + manifest = makeProtectedManifest(SteppedStrategy), verifyRoot = Cid.example, slotRoots = @[Cid.example, Cid.example] ).tryGet() - test "Should preserve interleaving strategy for protected manifest in verifiable manifest": check verifiable.protectedStrategy == SteppedStrategy + + verifiable = Manifest.new( + manifest = makeProtectedManifest(LinearStrategy), + verifyRoot = Cid.example, + slotRoots = @[Cid.example, Cid.example] + ).tryGet() + + check verifiable.protectedStrategy == LinearStrategy