check for both strategies in attribute inheritance test

This commit is contained in:
gmega 2024-06-21 17:37:53 -03:00
parent bf3d648634
commit cda0448611
No known key found for this signature in database
GPG Key ID: FFD8DAF00660270F
1 changed files with 20 additions and 12 deletions

View File

@ -77,25 +77,33 @@ checksuite "Manifest":
suite "Manifest - Attribute Inheritance": suite "Manifest - Attribute Inheritance":
let proc makeProtectedManifest(strategy: StrategyType): Manifest =
base = Manifest.new( Manifest.new(
treeCid = Cid.example, manifest = Manifest.new(
blockSize = 1.MiBs, treeCid = Cid.example,
datasetSize = 100.MiBs blockSize = 1.MiBs,
) datasetSize = 100.MiBs,
protected = Manifest.new( ),
manifest = base,
treeCid = Cid.example, treeCid = Cid.example,
datasetSize = 200.MiBs, datasetSize = 200.MiBs,
ecK = 1, ecK = 1,
ecM = 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, verifyRoot = Cid.example,
slotRoots = @[Cid.example, Cid.example] slotRoots = @[Cid.example, Cid.example]
).tryGet() ).tryGet()
test "Should preserve interleaving strategy for protected manifest in verifiable manifest":
check verifiable.protectedStrategy == SteppedStrategy check verifiable.protectedStrategy == SteppedStrategy
verifiable = Manifest.new(
manifest = makeProtectedManifest(LinearStrategy),
verifyRoot = Cid.example,
slotRoots = @[Cid.example, Cid.example]
).tryGet()
check verifiable.protectedStrategy == LinearStrategy