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>
This commit is contained in:
Yahya
2017-10-12 11:09:18 +03:00
committed by David Dias
parent 7d3cb8e87c
commit 3abdcdabbb
2 changed files with 3 additions and 2 deletions

View File

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