File tree 4 files changed +5
-6
lines changed
4 files changed +5
-6
lines changed Original file line number Diff line number Diff line change 63
63
"ipfs-block" : " ~0.8.1" ,
64
64
"ipfs-utils" : " ^0.4.0" ,
65
65
"ipld-dag-cbor" : " ~0.15.0" ,
66
- "ipld-dag-pb" : " ~0.17.3 " ,
66
+ "ipld-dag-pb" : " ^0.18.1 " ,
67
67
"ipld-raw" : " ^4.0.0" ,
68
68
"is-ipfs" : " ~0.6.1" ,
69
69
"is-pull-stream" : " 0.0.0" ,
109
109
"cross-env" : " ^6.0.0" ,
110
110
"dirty-chai" : " ^2.0.1" ,
111
111
"go-ipfs-dep" : " ^0.4.22" ,
112
- "interface-ipfs-core" : " ~0.114.0 " ,
112
+ "interface-ipfs-core" : " ipfs/interface-js-ipfs-core#update-dag-pb " ,
113
113
"ipfsd-ctl" : " ^0.47.1" ,
114
114
"nock" : " ^11.3.2" ,
115
115
"stream-equal" : " ^1.1.1"
Original file line number Diff line number Diff line change 1
1
'use strict'
2
2
3
- const dagPB = require ( 'ipld-dag-pb' )
4
3
const dagCBOR = require ( 'ipld-dag-cbor' )
5
4
const promisify = require ( 'promisify-es6' )
6
5
const CID = require ( 'cids' )
@@ -56,7 +55,7 @@ module.exports = (send) => {
56
55
if ( options . format === 'dag-cbor' ) {
57
56
serialized = dagCBOR . util . serialize ( dagNode )
58
57
} else if ( options . format === 'dag-pb' ) {
59
- serialized = dagPB . util . serialize ( dagNode )
58
+ serialized = dagNode . serialize ( )
60
59
} else {
61
60
// FIXME Hopefully already serialized...can we use IPLD to serialise instead?
62
61
serialized = dagNode
Original file line number Diff line number Diff line change @@ -48,7 +48,7 @@ module.exports = (send) => {
48
48
}
49
49
50
50
const links = result . Links . map ( l => new DAGLink ( l . Name , l . Size , l . Hash ) )
51
- const node = DAGNode . create ( Buffer . from ( result . Data , 'base64' ) , links )
51
+ const node = new DAGNode ( Buffer . from ( result . Data , 'base64' ) , links )
52
52
53
53
cache . set ( cidB58Str , node )
54
54
callback ( null , node )
Original file line number Diff line number Diff line change @@ -37,7 +37,7 @@ describe('.dag', function () {
37
37
38
38
it ( 'should be able to put and get a DAG node with format dag-pb' , async ( ) => {
39
39
const data = Buffer . from ( 'some data' )
40
- const node = DAGNode . create ( data )
40
+ const node = new DAGNode ( data )
41
41
42
42
let cid = await ipfs . dag . put ( node , { format : 'dag-pb' , hashAlg : 'sha2-256' } )
43
43
cid = cid . toV0 ( )
You can’t perform that action at this time.
0 commit comments