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

Agent version with package number #1121

Merged
merged 2 commits into from
Dec 1, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/core/components/id.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

const promisify = require('promisify-es6')
const setImmediate = require('async/setImmediate')
const pkgversion = require('../../../package.json').version

module.exports = function id (self) {
return promisify((opts, callback) => {
Expand All @@ -18,7 +19,7 @@ module.exports = function id (self) {
.map((ma) => ma.toString())
.filter((ma) => ma.indexOf('ipfs') >= 0)
.sort(),
agentVersion: 'js-ipfs',
agentVersion: `js-ipfs/${pkgversion}`,
protocolVersion: '9000'
}))
})
Expand Down
4 changes: 3 additions & 1 deletion test/http-api/extra/id.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ module.exports = (ctl) => {
expect(err).to.not.exist()
expect(result.id).to.equal(idResult.ID)
expect(result.publicKey).to.equal(idResult.PublicKey)
expect(result.agentVersion).to.equal(idResult.AgentVersion)
const agentComponents = result.agentVersion.split('/')
expect(agentComponents).lengthOf.above(1)
expect(agentComponents[0]).to.equal(idResult.AgentVersion)
expect(result.protocolVersion).to.equal(idResult.ProtocolVersion)
done()
})
Expand Down
4 changes: 3 additions & 1 deletion test/http-api/spec/id.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ module.exports = (http) => {
}, (res) => {
expect(res.result.ID).to.equal(idResult.ID)
expect(res.result.PublicKey).to.equal(idResult.PublicKey)
expect(res.result.AgentVersion).to.equal(idResult.AgentVersion)
const agentComponents = res.result.AgentVersion.split('/')
expect(agentComponents).lengthOf.above(1)
expect(agentComponents[0]).to.equal(idResult.AgentVersion)
expect(res.result.ProtocolVersion).to.equal(idResult.ProtocolVersion)
done()
})
Expand Down