This repository was archived by the owner on Mar 10, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 10 files changed +18
-13
lines changed Expand file tree Collapse file tree 10 files changed +18
-13
lines changed Original file line number Diff line number Diff line change 6868 "async" : " ^3.1.0" ,
6969 "browser-process-platform" : " ~0.1.1" ,
7070 "go-ipfs-dep" : " ^0.4.22" ,
71- "interface-ipfs-core" : " ^0.129 .0" ,
72- "ipfsd-ctl" : " ^1.0.2 " ,
71+ "interface-ipfs-core" : " ^0.131 .0" ,
72+ "ipfsd-ctl" : " ^2. 1.0" ,
7373 "it-all" : " ^1.0.1" ,
7474 "it-concat" : " ^1.0.0" ,
7575 "it-pipe" : " ^1.1.0" ,
Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ function toCoreInterface (res) {
2323 return {
2424 provideBufLen : res . ProvideBufLen ,
2525 wantlist : ( res . Wantlist || [ ] ) . map ( k => new CID ( k [ '/' ] ) ) ,
26- peers : ( res . Peers || [ ] ) . map ( p => new CID ( p ) ) ,
26+ peers : ( res . Peers || [ ] ) ,
2727 blocksReceived : new Big ( res . BlocksReceived ) ,
2828 dataReceived : new Big ( res . DataReceived ) ,
2929 blocksSent : new Big ( res . BlocksSent ) ,
Original file line number Diff line number Diff line change @@ -37,7 +37,7 @@ module.exports = configure(({ ky }) => {
3737 // https://github.com/ipfs/go-ipfs/blob/eb11f569b064b960d1aba4b5b8ca155a3bd2cb21/core/commands/dht.go#L395-L396
3838 for ( const { ID , Addrs } of message . Responses ) {
3939 return {
40- id : new CID ( ID ) ,
40+ id : ID ,
4141 addrs : ( Addrs || [ ] ) . map ( a => multiaddr ( a ) )
4242 }
4343 }
Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ module.exports = configure(({ ky }) => {
3535 if ( message . Type === 4 && message . Responses ) {
3636 for ( const { ID , Addrs } of message . Responses ) {
3737 yield {
38- id : new CID ( ID ) ,
38+ id : ID ,
3939 addrs : ( Addrs || [ ] ) . map ( a => multiaddr ( a ) )
4040 }
4141 }
Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ module.exports = configure(({ ky }) => {
3636 message . id = new CID ( message . id )
3737 if ( message . responses ) {
3838 message . responses = message . responses . map ( ( { ID , Addrs } ) => ( {
39- id : new CID ( ID ) ,
39+ id : ID ,
4040 addrs : ( Addrs || [ ] ) . map ( a => multiaddr ( a ) )
4141 } ) )
4242 } else {
Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ module.exports = configure(({ ky }) => {
3838 message . id = new CID ( message . id )
3939 if ( message . responses ) {
4040 message . responses = message . responses . map ( ( { ID , Addrs } ) => ( {
41- id : new CID ( ID ) ,
41+ id : ID ,
4242 addrs : ( Addrs || [ ] ) . map ( a => multiaddr ( a ) )
4343 } ) )
4444 }
Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ module.exports = configure(({ ky }) => {
2626 message = toCamel ( message )
2727 message . id = new CID ( message . id )
2828 message . responses = ( message . responses || [ ] ) . map ( ( { ID , Addrs } ) => ( {
29- id : new CID ( ID ) ,
29+ id : ID ,
3030 addrs : ( Addrs || [ ] ) . map ( a => multiaddr ( a ) )
3131 } ) )
3232 yield message
Original file line number Diff line number Diff line change 22
33const configure = require ( './lib/configure' )
44const toCamel = require ( './lib/object-to-camel' )
5+ const multiaddr = require ( 'multiaddr' )
56
67module . exports = configure ( ( { ky } ) => {
78 return async options => {
@@ -14,6 +15,12 @@ module.exports = configure(({ ky }) => {
1415 searchParams : options . searchParams
1516 } ) . json ( )
1617
17- return toCamel ( res )
18+ const output = toCamel ( res )
19+
20+ if ( output . addresses ) {
21+ output . addresses = output . addresses . map ( ma => multiaddr ( ma ) )
22+ }
23+
24+ return output
1825 }
1926} )
Original file line number Diff line number Diff line change 11'use strict'
22
3- const CID = require ( 'cids' )
43const multiaddr = require ( 'multiaddr' )
54const configure = require ( '../lib/configure' )
65
@@ -16,7 +15,7 @@ module.exports = configure(({ ky }) => {
1615 } ) . json ( )
1716
1817 return Object . keys ( res . Addrs ) . map ( id => ( {
19- id : new CID ( id ) ,
18+ id,
2019 addrs : ( res . Addrs [ id ] || [ ] ) . map ( a => multiaddr ( a ) )
2120 } ) )
2221 }
Original file line number Diff line number Diff line change 11'use strict'
22
33const multiaddr = require ( 'multiaddr' )
4- const CID = require ( 'cids' )
54const configure = require ( '../lib/configure' )
65
76module . exports = configure ( ( { ky } ) => {
@@ -25,7 +24,7 @@ module.exports = configure(({ ky }) => {
2524 const info = { }
2625 try {
2726 info . addr = multiaddr ( peer . Addr )
28- info . peer = new CID ( peer . Peer )
27+ info . peer = peer . Peer
2928 } catch ( error ) {
3029 info . error = error
3130 info . rawPeerInfo = peer
You can’t perform that action at this time.
0 commit comments