Skip to content
This repository has been archived by the owner on Aug 11, 2021. It is now read-only.

Commit

Permalink
fix: cleanup and remove deps
Browse files Browse the repository at this point in the history
  • Loading branch information
hugomrdias authored and vmx committed Apr 21, 2020
1 parent 3048e3e commit 886b06d
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 60 deletions.
1 change: 0 additions & 1 deletion .eslintignore

This file was deleted.

34 changes: 0 additions & 34 deletions .npmignore

This file was deleted.

2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,7 @@ to

### Features

* upgrade to new ipfs-block and blockservice ([1dd4dd2](https://github.com/ipld/js-ipld-dag-pb/commit/1dd4dd2))
* upgrade to new ipld-block and blockservice ([1dd4dd2](https://github.com/ipld/js-ipld-dag-pb/commit/1dd4dd2))



Expand Down
27 changes: 15 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@
"coverage": "aegir coverage",
"coverage-publish": "aegir coverage publish"
},
"files": [
"src",
"dist"
],
"pre-push": [
"lint-commits",
"lint",
Expand Down Expand Up @@ -66,24 +70,23 @@
"npm": ">=3.0.0"
},
"dependencies": {
"cids": "~0.8.0",
"buffer": "^5.5.0",
"cids": "~0.8.0",
"class-is": "^1.1.0",
"multicodec": "^1.0.0",
"multihashing-async": "~0.8.0",
"protons": "^1.1.0",
"stable": "~0.1.8"
"multicodec": "^1.0.1",
"multihashing-async": "~0.8.1",
"protons": "^1.0.2"
},
"devDependencies": {
"aegir": "^21.0.1",
"bs58": "^4.0.1",
"aegir": "^21.4.5",
"chai": "^4.2.0",
"detect-node": "^2.0.4",
"dirty-chai": "^2.0.1",
"fs-extra": "^9.0.0",
"ipfs-block": "~0.8.1",
"ipfs-block-service": "~0.17.0",
"ipfs-repo": "^1.0.0",
"multihashes": "~0.4.15"
"ipfs-block-service": "~0.16.0",
"ipfs-repo": "ipfs/js-ipfs-repo#fix/remove-node-globals",
"ipfs-utils": "^1.2.1",
"ipld-block": "~0.9.1",
"multibase": "^0.7.0",
"multihashes": "~0.4.19"
}
}
6 changes: 1 addition & 5 deletions test/browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,7 @@ const IPFSRepo = require('ipfs-repo')

const basePath = 'ipfs' + Math.random()

const idb = self.indexedDB ||
self.mozIndexedDB ||
self.webkitIndexedDB ||
self.msIndexedDB

const idb = self.indexedDB
idb.deleteDatabase(basePath)
idb.deleteDatabase(basePath + '/blocks')

Expand Down
23 changes: 16 additions & 7 deletions test/dag-node-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,15 @@ chai.use(dirtyChai)
const dagPB = require('../src')
const DAGLink = dagPB.DAGLink
const DAGNode = dagPB.DAGNode
const isNode = require('detect-node')
const { isNode } = require('ipfs-utils/src/env')
const multihash = require('multihashes')
const multicodec = require('multicodec')
const multihashing = require('multihashing-async')

const BlockService = require('ipfs-block-service')
const Block = require('ipfs-block')
const Block = require('ipld-block')
const CID = require('cids')
const multibase = require('multibase')
const bs58 = require('bs58')
const loadFixture = require('aegir/fixtures')

Expand Down Expand Up @@ -472,11 +473,19 @@ module.exports = (repo) => {
Hash: 'QmP7SrR76KHK9A916RbHG1ufy2TzNABZgiE23PjZDMzZXy',
Size: 262158
}

const link1 = new DAGLink(l1.Name, l1.Tsize,
Buffer.from(bs58.decode(l1.Hash)))
const link2 = new DAGLink(l2.Name, l2.Tsize,
Buffer.from(bs58.decode(l2.Hash)))
console.log(multibase.decode('z' + l1.Hash), bs58.decode(l1.Hash))
const link1 = new DAGLink(
l1.Name,
l1.Tsize,
multibase.decode('z' + l1.Hash)
// Buffer.from(bs58.decode(l1.Hash))
)
const link2 = new DAGLink(
l2.Name,
l2.Tsize,
multibase.decode('z' + l2.Hash)
// Buffer.from(bs58.decode(l2.Hash))
)

const node = new DAGNode(Buffer.from('hiya'), [link1, link2])
expect(node.Links).to.have.lengthOf(2)
Expand Down

0 comments on commit 886b06d

Please sign in to comment.