mirror of
https://github.com/logos-storage/logos-storage-nim.git
synced 2026-01-09 08:53:10 +00:00
wip
This commit is contained in:
parent
47ca93f18c
commit
ad63969f20
28
tests/dagger/testblockset.nim
Normal file
28
tests/dagger/testblockset.nim
Normal file
@ -0,0 +1,28 @@
|
||||
|
||||
import pkg/chronos
|
||||
import pkg/questionable
|
||||
import pkg/questionable/results
|
||||
import pkg/asynctest
|
||||
import pkg/libp2p
|
||||
import pkg/stew/byteutils as stew
|
||||
|
||||
import pkg/dagger/chunker
|
||||
import pkg/dagger/rng
|
||||
import pkg/dagger/blocktype as bt
|
||||
import pkg/dagger/blockstream
|
||||
import pkg/dagger/blockset
|
||||
|
||||
suite "Data set":
|
||||
test "Make from Blocks":
|
||||
let
|
||||
blockStream = ChunkedBlockStreamRef.new(
|
||||
newRandomChunker(Rng.instance(), size = 256 * 7, chunkSize = 256))
|
||||
blockSet = BlockSetRef.new(stream = blockStream)
|
||||
|
||||
let res = blockSet.treeHash()
|
||||
check res.isOK
|
||||
if h =? res:
|
||||
echo h.hashBytes()
|
||||
return
|
||||
|
||||
echo res.error.msg
|
||||
Loading…
x
Reference in New Issue
Block a user