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

Commit

Permalink
fixup! feat!: update interface-ipfs-core DAG API to match go-ipfs@0.10
Browse files Browse the repository at this point in the history
  • Loading branch information
rvagg committed Oct 16, 2021
1 parent 3ecbd8b commit 6af1270
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/interface-ipfs-core/src/block/get.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export function testGet (factory, options) {

it('should get an empty block', async () => {
const cid = await ipfs.block.put(new Uint8Array(0), {
storeCodec: 'dag-pb',
format: 'dag-pb',
mhtype: 'sha2-256',
version: 0
})
Expand Down
4 changes: 2 additions & 2 deletions packages/interface-ipfs-core/src/utils/blockstore-adapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { toString as uint8ArrayToString } from 'uint8arrays/to-string'
/**
* @type {Record<number, string>}
*/
const codecNames = {
const formats = {
[raw.code]: raw.name,
[dagPB.code]: dagPB.name,
[dagCBOR.code]: dagCBOR.name
Expand Down Expand Up @@ -37,7 +37,7 @@ class IPFSBlockstore extends BaseBlockstore {
*/
async put (cid, buf) {
const c = await this.ipfs.block.put(buf, {
storeCodec: codecNames[cid.code],
format: formats[cid.code],
mhtype: hashes[cid.multihash.code],
version: cid.version
})
Expand Down

0 comments on commit 6af1270

Please sign in to comment.