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

Commit

Permalink
chore: upgrade to go-ipfs 0.7.0 (#3314)
Browse files Browse the repository at this point in the history
Tests against the latest go-ipfs release.
  • Loading branch information
achingbrain authored Oct 6, 2020
1 parent 69757f3 commit 9db0452
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 9 deletions.
2 changes: 1 addition & 1 deletion examples/browser-ipns-publish/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"delay": "^4.4.0",
"execa": "^4.0.0",
"ipfsd-ctl": "^7.0.0",
"go-ipfs": "^0.6.0",
"go-ipfs": "^0.7.0",
"parcel-bundler": "^1.12.4",
"path": "^0.12.7",
"test-ipfs-example": "^2.0.3"
Expand Down
2 changes: 1 addition & 1 deletion examples/http-client-browser-pubsub/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
],
"devDependencies": {
"execa": "^4.0.0",
"go-ipfs": "^0.6.0",
"go-ipfs": "^0.7.0",
"ipfs": "^0.50.1",
"ipfsd-ctl": "^7.0.0",
"parcel-bundler": "^1.12.4",
Expand Down
2 changes: 1 addition & 1 deletion examples/http-client-name-api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
},
"devDependencies": {
"execa": "^4.0.0",
"go-ipfs": "^0.6.0",
"go-ipfs": "^0.7.0",
"ipfsd-ctl": "^7.0.0",
"parcel-bundler": "^1.12.4",
"test-ipfs-example": "^2.0.3"
Expand Down
2 changes: 1 addition & 1 deletion examples/http-client-name-api/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ module.exports[pkg.name] = function (browser) {
.pause(1000)
.click('#add-file-submit')

browser.expect.element('#publish-result').text.to.contain('/ipns/Qm')
browser.expect.element('#publish-result').text.to.contain('/ipns/k')

// resolve a name
browser.getText('#publish-result', (result) => {
Expand Down
12 changes: 9 additions & 3 deletions packages/interface-ipfs-core/src/name/publish.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const { fixture } = require('./utils')
const { getDescribe, getIt, expect } = require('../utils/mocha')
const last = require('it-last')
const testTimeout = require('../utils/test-timeout')
const CID = require('cids')

/** @typedef { import("ipfsd-ctl/src/factory") } Factory */
/**
Expand Down Expand Up @@ -41,10 +42,13 @@ module.exports = (common, options) => {
this.timeout(50 * 1000)

const value = fixture.cid
const keys = await ipfs.key.list()
const self = keys.find(key => key.name === 'self')

const res = await ipfs.name.publish(value, { allowOffline: true })
expect(res).to.exist()
expect(res.name).to.equal(nodeId)

expect(new CID(res.name).toV1().toString('base36')).to.equal(new CID(self.id).toV1().toString('base36'))
expect(res.value).to.equal(`/ipfs/${value}`)
})

Expand All @@ -58,6 +62,8 @@ module.exports = (common, options) => {
this.timeout(50 * 1000)

const value = 'QmPFVLPmp9zv5Z5KUqLhe2EivAGccQW2r7M7jhVJGLZoZU'
const keys = await ipfs.key.list()
const self = keys.find(key => key.name === 'self')

const options = {
resolve: false,
Expand All @@ -69,7 +75,7 @@ module.exports = (common, options) => {

const res = await ipfs.name.publish(value, options)
expect(res).to.exist()
expect(res.name).to.equal(nodeId)
expect(new CID(res.name).toV1().toString('base36')).to.equal(new CID(self.id).toV1().toString('base36'))
expect(res.value).to.equal(`/ipfs/${value}`)
})

Expand All @@ -89,7 +95,7 @@ module.exports = (common, options) => {
const res = await ipfs.name.publish(value, options)

expect(res).to.exist()
expect(res.name).to.equal(key.id)
expect(new CID(res.name).toV1().toString('base36')).to.equal(new CID(key.id).toV1().toString('base36'))
expect(res.value).to.equal(`/ipfs/${value}`)
})
})
Expand Down
2 changes: 1 addition & 1 deletion packages/ipfs-http-client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
"devDependencies": {
"aegir": "^26.0.0",
"cross-env": "^7.0.0",
"go-ipfs": "^0.6.0",
"go-ipfs": "^0.7.0",
"interface-ipfs-core": "^0.140.0",
"ipfsd-ctl": "^7.0.0",
"it-all": "^1.0.4",
Expand Down
2 changes: 1 addition & 1 deletion packages/ipfs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"cross-env": "^7.0.0",
"delay": "^4.4.0",
"form-data": "^3.0.0",
"go-ipfs": "^0.6.0",
"go-ipfs": "^0.7.0",
"interface-ipfs-core": "^0.140.0",
"ipfs-http-client": "^47.0.1",
"ipfs-interop": "^3.0.0",
Expand Down

0 comments on commit 9db0452

Please sign in to comment.