From 67207228a8ad7bbfaf66db73493166c6ec01b2e6 Mon Sep 17 00:00:00 2001 From: Rod Vagg Date: Mon, 15 Nov 2021 20:01:34 +1100 Subject: [PATCH] fixup! feat!: update interface-ipfs-core DAG API to match go-ipfs@0.10 --- packages/interface-ipfs-core/src/dag/get.js | 4 ++-- packages/interface-ipfs-core/src/object/stat.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/interface-ipfs-core/src/dag/get.js b/packages/interface-ipfs-core/src/dag/get.js index 37d392bec5..3f81031df2 100644 --- a/packages/interface-ipfs-core/src/dag/get.js +++ b/packages/interface-ipfs-core/src/dag/get.js @@ -73,7 +73,7 @@ export function testGet (factory, options) { Data: uint8ArrayFromString('I am inside a Protobuf'), Links: [] } - cidPb = CID.createV0(await sha256.digest(dagPB.encode(nodePb))) + cidPb = CID.createV1(dagPB.code, await sha256.digest(dagPB.encode(nodePb))) nodeCbor = { someData: 'I am inside a Cbor object', pb: cidPb @@ -122,7 +122,7 @@ export function testGet (factory, options) { const node = result.value - const cid = CID.createV0(await sha256.digest(dagPB.encode(node))) + const cid = CID.createV1(dagPB.code, await sha256.digest(dagPB.encode(node))) expect(cid.equals(cidPb)).to.be.true() }) diff --git a/packages/interface-ipfs-core/src/object/stat.js b/packages/interface-ipfs-core/src/object/stat.js index bb715fb29f..80fdb65388 100644 --- a/packages/interface-ipfs-core/src/object/stat.js +++ b/packages/interface-ipfs-core/src/object/stat.js @@ -41,7 +41,7 @@ export function testStat (factory, options) { const cid = await ipfs.object.put(testObj) const stats = await ipfs.object.stat(cid) const expected = { - Hash: CID.parse('QmNggDXca24S6cMPEYHZjeuc4QRmofkRrAEqVL3Ms2sdJZ'), + Hash: CID.parse('QmNggDXca24S6cMPEYHZjeuc4QRmofkRrAEqVL3Ms2sdJZ').toV1(), NumLinks: 0, BlockSize: 17, LinksSize: 2,