wires slot and indexing tests up

This commit is contained in:
benbierens 2023-12-04 09:23:18 +01:00 committed by Dmitriy Ryajov
parent 2c2e42d363
commit d4ed43bc05
No known key found for this signature in database
GPG Key ID: DA8C680CE7C657A4
3 changed files with 27 additions and 22 deletions

View File

@ -89,29 +89,29 @@ asyncchecksuite "Slot builder":
check:
SlotBuilder.new(localStore, mismatchManifest).isErr
for i in 0 ..< numberOfSlots:
test "Can create slot manifest given index (" & $i & ")":
let
selectStart = i * numberOfSlotBlocks
selectEnd = selectStart + numberOfSlotBlocks
expectedCids = datasetBlocks.mapIt(it.cid)[selectStart ..< selectEnd]
m = (await slotBuilder.createSlotIntermediateManifest(i)).tryGet()
# for i in 0 ..< numberOfSlots:
# test "Can create slot manifest given index (" & $i & ")":
# let
# selectStart = i * numberOfSlotBlocks
# selectEnd = selectStart + numberOfSlotBlocks
# expectedCids = datasetBlocks.mapIt(it.cid)[selectStart ..< selectEnd]
# m = (await slotBuilder.createSlotIntermediateManifest(i)).tryGet()
check:
m.treeCid # check
m.datasetSize == (numberOfSlotBlocks * blockSize).NBytes
m.blockSize == blockSize
m.version == manifest.version
m.hcodec == manifest.hcodec
m.codec == manifest.codec
#m.ecK == ??
#m.ecM == ??
m.originalTreeCid == manifest.originalTreeCid
m.originalDatasetSize = manifest.originalDatasetSize
# check:
# m.treeCid # check
# m.datasetSize == (numberOfSlotBlocks * blockSize).NBytes
# m.blockSize == blockSize
# m.version == manifest.version
# m.hcodec == manifest.hcodec
# m.codec == manifest.codec
# #m.ecK == ??
# #m.ecM == ??
# m.originalTreeCid == manifest.originalTreeCid
# m.originalDatasetSize = manifest.originalDatasetSize
m.isSlot == true
m.datasetSlotIndex == i
m.originalProtectedTreeCide == manifest.treeCid
m.originalProtectedDatasetSize == manifest.datasetSize
# m.isSlot == true
# m.datasetSlotIndex == i
# m.originalProtectedTreeCide == manifest.treeCid
# m.originalProtectedDatasetSize == manifest.datasetSize

View File

@ -0,0 +1,3 @@
import ./slotbuilder/testslotbuilder
{.warning[UnusedImport]: off.}

View File

@ -14,5 +14,7 @@ import ./codex/testsystemclock
import ./codex/testvalidation
import ./codex/testasyncstreamwrapper
import ./codex/testmerkletree
import ./codex/testslotbuilder
import ./codex/testindexingstrategy
{.warning[UnusedImport]: off.}