This commit is contained in:
Dmitriy Ryajov 2021-08-27 15:38:02 -06:00
parent 47ca93f18c
commit ad63969f20
No known key found for this signature in database
GPG Key ID: DA8C680CE7C657A4
1 changed files with 28 additions and 0 deletions

View 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