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: check:
SlotBuilder.new(localStore, mismatchManifest).isErr SlotBuilder.new(localStore, mismatchManifest).isErr
for i in 0 ..< numberOfSlots: # for i in 0 ..< numberOfSlots:
test "Can create slot manifest given index (" & $i & ")": # test "Can create slot manifest given index (" & $i & ")":
let # let
selectStart = i * numberOfSlotBlocks # selectStart = i * numberOfSlotBlocks
selectEnd = selectStart + numberOfSlotBlocks # selectEnd = selectStart + numberOfSlotBlocks
expectedCids = datasetBlocks.mapIt(it.cid)[selectStart ..< selectEnd] # expectedCids = datasetBlocks.mapIt(it.cid)[selectStart ..< selectEnd]
m = (await slotBuilder.createSlotIntermediateManifest(i)).tryGet() # m = (await slotBuilder.createSlotIntermediateManifest(i)).tryGet()
check: # check:
m.treeCid # check # m.treeCid # check
m.datasetSize == (numberOfSlotBlocks * blockSize).NBytes # m.datasetSize == (numberOfSlotBlocks * blockSize).NBytes
m.blockSize == blockSize # m.blockSize == blockSize
m.version == manifest.version # m.version == manifest.version
m.hcodec == manifest.hcodec # m.hcodec == manifest.hcodec
m.codec == manifest.codec # m.codec == manifest.codec
#m.ecK == ?? # #m.ecK == ??
#m.ecM == ?? # #m.ecM == ??
m.originalTreeCid == manifest.originalTreeCid # m.originalTreeCid == manifest.originalTreeCid
m.originalDatasetSize = manifest.originalDatasetSize # m.originalDatasetSize = manifest.originalDatasetSize
m.isSlot == true # m.isSlot == true
m.datasetSlotIndex == i # m.datasetSlotIndex == i
m.originalProtectedTreeCide == manifest.treeCid # m.originalProtectedTreeCide == manifest.treeCid
m.originalProtectedDatasetSize == manifest.datasetSize # 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/testvalidation
import ./codex/testasyncstreamwrapper import ./codex/testasyncstreamwrapper
import ./codex/testmerkletree import ./codex/testmerkletree
import ./codex/testslotbuilder
import ./codex/testindexingstrategy
{.warning[UnusedImport]: off.} {.warning[UnusedImport]: off.}