This repository was archived by the owner on Jul 21, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change 5050 "libp2p-record" : " ~0.6.1" ,
5151 "multihashes" : " ~0.4.14" ,
5252 "multihashing-async" : " ~0.5.1" ,
53- "peer-id" : " ~0.11.0 " ,
53+ "peer-id" : " ~0.12.1 " ,
5454 "peer-info" : " ~0.15.0" ,
5555 "priorityqueue" : " ~0.2.1" ,
5656 "protons" : " ^1.0.1" ,
Original file line number Diff line number Diff line change @@ -13,8 +13,9 @@ const retry = require('async/retry')
1313const each = require ( 'async/each' )
1414const waterfall = require ( 'async/waterfall' )
1515const random = require ( 'lodash.random' )
16- const _ = require ( 'lodash' )
1716const Record = require ( 'libp2p-record' ) . Record
17+ const PeerId = require ( 'peer-id' )
18+ const PeerInfo = require ( 'peer-info' )
1819const PeerBook = require ( 'peer-book' )
1920const Switch = require ( 'libp2p-switch' )
2021const TCP = require ( 'libp2p-tcp' )
@@ -32,9 +33,9 @@ const TestDHT = require('./utils/test-dht')
3233
3334// connect two dhts
3435function connectNoSync ( a , b , callback ) {
35- const target = _ . cloneDeep ( b . peerInfo )
36- target . id . _pubKey = target . id . pubKey
37- target . id . _privKey = null
36+ const publicPeerId = new PeerId ( b . peerInfo . id . id , null , b . peerInfo . id . pubKey )
37+ const target = new PeerInfo ( publicPeerId )
38+ target . multiaddrs = b . peerInfo . multiaddrs
3839 a . switch . dial ( target , callback )
3940}
4041
You can’t perform that action at this time.
0 commit comments