diff --git a/packages/upload-client/src/index.js b/packages/upload-client/src/index.js index 7c8ab1e8d..54a0bf56e 100644 --- a/packages/upload-client/src/index.js +++ b/packages/upload-client/src/index.js @@ -134,12 +134,15 @@ async function uploadBlockStream( const bytes = new Uint8Array(await car.arrayBuffer()) // Invoke blob/add and write bytes to write target const multihash = await Blob.add(conf, bytes, options) + // Should this be raw instead? const cid = Link.create(carCodec.code, multihash) let piece if (pieceHasher) { const multihashDigest = await pieceHasher.digest(bytes) /** @type {import('@web3-storage/capabilities/types').PieceLink} */ piece = Link.create(raw.code, multihashDigest) + const content = Link.create(raw.code, multihash) + // Invoke filecoin/offer for data const result = await Storefront.filecoinOffer( { @@ -149,7 +152,7 @@ async function uploadBlockStream( with: conf.issuer.did(), proofs: conf.proofs, }, - cid, + content, piece, options ) diff --git a/packages/upload-client/test/helpers/car.js b/packages/upload-client/test/helpers/car.js index b802cc889..56d2b3a9b 100644 --- a/packages/upload-client/test/helpers/car.js +++ b/packages/upload-client/test/helpers/car.js @@ -7,7 +7,6 @@ import { toBlock } from './block.js' */ export async function toCAR(bytes) { const block = await toBlock(bytes) - // @ts-expect-error old multiformats in @ipld/car const { writer, out } = CarWriter.create(block.cid) writer.put(block) writer.close() diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index c37e227e0..8a4aea6f0 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1,4 +1,4 @@ -lockfileVersion: '6.0' +lockfileVersion: '6.1' settings: autoInstallPeers: true