Compare commits

..

4 Commits

Author SHA1 Message Date
8f6935499e chore: release version v0.10.2 2017-10-12 10:21:43 +02:00
80da1a54b2 chore: update contributors 2017-10-12 10:21:43 +02:00
300266ad51 chore: update deps 2017-10-12 10:20:43 +02:00
3abdcdabbb fix: Always add public key to constructor if possible, Fix for undefined pubKey in remote peers (#68)
* Always add public key to constructor if possible

* extending Non-default # of bits test time, travis took 59521ms

License: MIT
Signed-off-by: Yahya <ya7yaz@gmail.com>
2017-10-12 10:09:18 +02:00
4 changed files with 16 additions and 4 deletions

View File

@ -1,3 +1,13 @@
<a name="0.10.2"></a>
## [0.10.2](https://github.com/libp2p/js-peer-id/compare/v0.10.1...v0.10.2) (2017-10-12)
### Bug Fixes
* Always add public key to constructor if possible, Fix for undefined pubKey in remote peers ([#68](https://github.com/libp2p/js-peer-id/issues/68)) ([3abdcda](https://github.com/libp2p/js-peer-id/commit/3abdcda))
<a name="0.10.1"></a> <a name="0.10.1"></a>
## [0.10.1](https://github.com/libp2p/js-peer-id/compare/v0.10.0...v0.10.1) (2017-09-07) ## [0.10.1](https://github.com/libp2p/js-peer-id/compare/v0.10.0...v0.10.1) (2017-09-07)

View File

@ -1,6 +1,6 @@
{ {
"name": "peer-id", "name": "peer-id",
"version": "0.10.1", "version": "0.10.2",
"description": "IPFS Peer Id implementation in Node.js", "description": "IPFS Peer Id implementation in Node.js",
"main": "src/index.js", "main": "src/index.js",
"bin": "src/bin.js", "bin": "src/bin.js",
@ -33,7 +33,7 @@
}, },
"homepage": "https://github.com/libp2p/js-peer-id", "homepage": "https://github.com/libp2p/js-peer-id",
"devDependencies": { "devDependencies": {
"aegir": "^12.0.6", "aegir": "^12.0.8",
"chai": "^4.1.2", "chai": "^4.1.2",
"dirty-chai": "^2.0.1", "dirty-chai": "^2.0.1",
"pre-commit": "^1.2.2" "pre-commit": "^1.2.2"
@ -55,6 +55,7 @@
"Prashanth Chandra <coolshanth94@gmail.com>", "Prashanth Chandra <coolshanth94@gmail.com>",
"Richard Littauer <richard.littauer@gmail.com>", "Richard Littauer <richard.littauer@gmail.com>",
"Stephen Whitmore <stephen.whitmore@gmail.com>", "Stephen Whitmore <stephen.whitmore@gmail.com>",
"Yahya <ya7yaz@gmail.com>",
"greenkeeperio-bot <support@greenkeeper.io>", "greenkeeperio-bot <support@greenkeeper.io>",
"nginnever <ginneversource@gmail.com>", "nginnever <ginneversource@gmail.com>",
"npmcdn-to-unpkg-bot <npmcdn-to-unpkg-bot@users.noreply.github.com>" "npmcdn-to-unpkg-bot <npmcdn-to-unpkg-bot@users.noreply.github.com>"

View File

@ -202,7 +202,7 @@ exports.createFromPrivKey = function (key, callback) {
return callback(err) return callback(err)
} }
callback(null, new PeerId(digest, privKey)) callback(null, new PeerId(digest, privKey, privKey.public))
}) })
} }

View File

@ -85,6 +85,7 @@ describe('PeerId', () => {
PeerId.createFromPrivKey(encoded, (err, id2) => { PeerId.createFromPrivKey(encoded, (err, id2) => {
expect(err).to.not.exist() expect(err).to.not.exist()
expect(testIdB58String).to.equal(id2.toB58String()) expect(testIdB58String).to.equal(id2.toB58String())
expect(id.marshalPubKey()).to.deep.equal(id2.marshalPubKey())
done() done()
}) })
}) })
@ -104,7 +105,7 @@ describe('PeerId', () => {
it('Non-default # of bits', function (done) { it('Non-default # of bits', function (done) {
// rsa is slow atm // rsa is slow atm
this.timeout(20000) this.timeout(100000)
PeerId.create({ bits: 1024 }, (err, shortId) => { PeerId.create({ bits: 1024 }, (err, shortId) => {
expect(err).to.not.exist() expect(err).to.not.exist()
PeerId.create({ bits: 4096 }, (err, longId) => { PeerId.create({ bits: 4096 }, (err, longId) => {