Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

Commit

Permalink
fix: ts types after multihashing-async release
Browse files Browse the repository at this point in the history
The new types in multihashing-async are unsurprisingly stricter than
using no types at all.

fixes #3527
  • Loading branch information
achingbrain committed Feb 4, 2021
1 parent 9cbc09c commit dcb411b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/ipfs-core/src/components/block/put.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ module.exports = ({ blockService, pin, gcLock, preload }) => {
cidVersion = options.version
}

const multihash = await multihashing(block, mhtype)
const multihash = await multihashing(bytes, mhtype)
const cid = new CID(cidVersion, format, multihash)

block = new Block(bytes, cid)
Expand Down Expand Up @@ -120,7 +120,7 @@ module.exports = ({ blockService, pin, gcLock, preload }) => {
* @typedef {Object} PutOptions
* @property {CID} [cid] - A CID to store the block under (default: `undefined`)
* @property {string} [format='dag-pb'] - The codec to use to create the CID (default: `'dag-pb'`)
* @property {string} [mhtype='sha2-256'] - The hashing algorithm to use to create the CID (default: `'sha2-256'`)
* @property {import('multihashes').HashName} [mhtype='sha2-256'] - The hashing algorithm to use to create the CID (default: `'sha2-256'`)
* @property {number} [mhlen]
* @property {CIDVersion} [version=0] - The version to use to create the CID (default: `0`)
* @property {boolean} [pin=false] - If true, pin added blocks recursively (default: `false`)
Expand Down

0 comments on commit dcb411b

Please sign in to comment.