Skip to content

Commit

Permalink
feat: update to use go-ipfs v0.4.9 and latest ipfs-block
Browse files Browse the repository at this point in the history
  • Loading branch information
daviddias committed May 19, 2017
1 parent 54a96a8 commit 94f0a97
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 30 deletions.
19 changes: 10 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,23 +47,24 @@
],
"license": "MIT",
"dependencies": {
"async": "^2.1.5",
"go-ipfs-dep": "0.4.7",
"ipfs-api": "^12.1.7",
"multiaddr": "^2.2.2",
"async": "^2.4.0",
"go-ipfs-dep": "0.4.9",
"ipfs-api": "^14.0.1",
"multiaddr": "^2.3.0",
"once": "^1.4.0",
"rimraf": "^2.6.1",
"shutdown": "^0.2.4",
"shutdown": "^0.3.0",
"subcomandante": "^1.0.5"
},
"devDependencies": {
"aegir": "^11.0.0",
"aegir": "^11.0.2",
"chai": "^3.5.0",
"dirty-chai": "^1.2.2",
"is-running": "1.0.5",
"mkdirp": "^0.5.1",
"multihashes": "~0.4.4",
"pre-commit": "^1.2.2"
"multihashes": "~0.4.5",
"pre-commit": "^1.2.2",
"safe-buffer": "^5.0.1"
},
"repository": {
"type": "git",
Expand All @@ -77,4 +78,4 @@
"example": "examples",
"test": "test"
}
}
}
33 changes: 12 additions & 21 deletions test/index.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ const dirtyChai = require('dirty-chai')
const expect = chai.expect
chai.use(dirtyChai)
const ipfsApi = require('ipfs-api')
const mh = require('multihashes')
const multiaddr = require('multiaddr')
const Buffer = require('safe-buffer').Buffer
const fs = require('fs')
const rimraf = require('rimraf')
const mkdirp = require('mkdirp')
Expand All @@ -22,6 +22,7 @@ const ipfsd = require('../src')

describe('ipfs executable path', () => {
let Node

it('has the correct path when installed with npm3', (done) => {
process.env.testpath = '/tmp/ipfsd-ctl-test/node_modules/ipfsd-ctl/lib' // fake __dirname
let npm3Path = '/tmp/ipfsd-ctl-test/node_modules/go-ipfs-dep/go-ipfs'
Expand All @@ -35,11 +36,8 @@ describe('ipfs executable path', () => {
delete require.cache[require.resolve('../src/node.js')]
Node = require('../src/node.js')
var node = new Node()
expect(
node.exec
).to.be.eql(
'/tmp/ipfsd-ctl-test/node_modules/go-ipfs-dep/go-ipfs/ipfs'
)
expect(node.exec)
.to.eql('/tmp/ipfsd-ctl-test/node_modules/go-ipfs-dep/go-ipfs/ipfs')
rimraf('/tmp/ipfsd-ctl-test', done)
})
})
Expand Down Expand Up @@ -95,17 +93,16 @@ describe('daemons', () => {
})

describe('disposable node', () => {
const blorb = new Buffer('blorb')
const blorb = Buffer.from('blorb')
let ipfs
let store
let retrieve

beforeEach((done) => {
async.waterfall([
(cb) => ipfs.block.put(blorb, cb),
(block, cb) => block.key(cb),
(key, cb) => {
store = mh.toB58String(key)
(block, cb) => {
store = block.cid.toBaseEncodedString()
ipfs.block.get(store, cb)
},
(_block, cb) => {
Expand Down Expand Up @@ -137,11 +134,8 @@ describe('daemons', () => {
})

it('should be able to store objects', () => {
expect(
store
).to.be.eql(
'QmPv52ekjS75L4JmHpXVeuJ5uX2ecSfSZo88NSyxwA3rAQ'
)
expect(store)
.to.eql('QmPv52ekjS75L4JmHpXVeuJ5uX2ecSfSZo88NSyxwA3rAQ')
})

it('should be able to retrieve objects', () => {
Expand All @@ -168,11 +162,8 @@ describe('daemons', () => {
})

it('should be able to store objects', () => {
expect(
store
).to.be.eql(
'QmPv52ekjS75L4JmHpXVeuJ5uX2ecSfSZo88NSyxwA3rAQ'
)
expect(store)
.to.eql('QmPv52ekjS75L4JmHpXVeuJ5uX2ecSfSZo88NSyxwA3rAQ')
})

it('should be able to retrieve objects', () => {
Expand Down Expand Up @@ -366,7 +357,7 @@ describe('daemons', () => {
it('prints the version', (done) => {
ipfsd.version((err, version) => {
expect(err).to.not.exist()
expect(version).to.be.eql('ipfs version 0.4.7')
expect(version).to.be.eql('ipfs version 0.4.9')
done()
})
})
Expand Down

0 comments on commit 94f0a97

Please sign in to comment.