From 7c98e78b3ecf180e30ba3e4d82cf5428ebeffd2d Mon Sep 17 00:00:00 2001 From: Dmitriy Ryajov Date: Fri, 27 Aug 2021 16:11:33 -0600 Subject: [PATCH] fix chunker tests --- dagger/blocktype.nim | 11 ----------- tests/dagger/dataset.nim | 20 -------------------- 2 files changed, 31 deletions(-) delete mode 100644 tests/dagger/dataset.nim diff --git a/dagger/blocktype.nim b/dagger/blocktype.nim index 8f201fdd..c4e65afd 100644 --- a/dagger/blocktype.nim +++ b/dagger/blocktype.nim @@ -34,17 +34,6 @@ func new*( cid: Cid.init(version, codec, hash).get(), data: @data) -func new*( - T: type Block, - data: openArray[byte] = [], - version = CIDv1, - hcodec = multiCodec("sha2-256"), - codec = multiCodec("raw")): ?!T = - let hash = MultiHash.digest($hcodec, data).get() - success Block( - cid: Cid.init(version, codec, hash).get(), - data: @data) - func new*( T: type Block, cid: Cid, diff --git a/tests/dagger/dataset.nim b/tests/dagger/dataset.nim deleted file mode 100644 index ab01ef03..00000000 --- a/tests/dagger/dataset.nim +++ /dev/null @@ -1,20 +0,0 @@ -import std/sequtils - -import pkg/chronos -import pkg/asynctest -import pkg/stew/results -import pkg/dagger/chunker -import pkg/dagger/merkletree -import pkg/stew/byteutils -import pkg/dagger/p2p/rng -import pkg/dagger/blocktype as bt - -suite "Data set": - - test "Make from Blocks": - let - chunker = newRandomChunker(Rng.instance(), size = 256*3, chunkSize = 256) - blocks = chunker.mapIt( bt.Block.new(it) ) - - let merkle = MerkleTreeRef.fromBlocks(blocks) -