From 10844c0bd571d7f90e78fc1b85dd1ad7ed527eff Mon Sep 17 00:00:00 2001 From: Dmitriy Ryajov Date: Fri, 27 Aug 2021 11:02:35 -0600 Subject: [PATCH] use CidV1 and raw multicodec as default --- dagger/blocktype.nim | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/dagger/blocktype.nim b/dagger/blocktype.nim index 7833a3c4..4e825b89 100644 --- a/dagger/blocktype.nim +++ b/dagger/blocktype.nim @@ -7,12 +7,11 @@ ## This file may not be copied, modified, or distributed except according to ## those terms. -import pkg/libp2p/multihash -import pkg/libp2p/multicodec -import pkg/libp2p/cid -import pkg/stew/byteutils +{.push raises: [Defect].} -export cid, multihash, multicodec +import pkg/libp2p +import pkg/questionable +import pkg/stew/byteutils type CidDontMatchError* = object of CatchableError @@ -46,9 +45,9 @@ proc new*( proc new*( T: type Block, data: openArray[byte] = [], - version = CIDv0, + version = CIDv1, hcodec = multiCodec("sha2-256"), - codec = multiCodec("dag-pb")): T = + codec = multiCodec("raw")): T = let hash = MultiHash.digest($hcodec, data).get() Block( cid: Cid.init(version, codec, hash).get(),