This repository was archived by the owner on Mar 10, 2020. It is now read-only.
File tree 2 files changed +12
-2
lines changed
2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change 47
47
"hat" : " 0.0.3" ,
48
48
"ipfs-block" : " ~0.8.0" ,
49
49
"ipfs-unixfs" : " ^0.3.0" ,
50
- "ipfs-utils" : " ^0.6.0 " ,
50
+ "ipfs-utils" : " ^0.7.1 " ,
51
51
"ipld-dag-cbor" : " ~0.15.0" ,
52
52
"ipld-dag-pb" : " ^0.18.1" ,
53
53
"is-ipfs" : " ~0.6.1" ,
64
64
},
65
65
"devDependencies" : {
66
66
"aegir" : " ^20.3.2" ,
67
- "ipfsd-ctl" : " ^1.0 .0"
67
+ "ipfsd-ctl" : " ^2.1 .0"
68
68
},
69
69
"contributors" : [
70
70
" Alan Shaw <alan.shaw@protocol.ai>" ,
Original file line number Diff line number Diff line change @@ -45,6 +45,16 @@ module.exports = (common, options) => {
45
45
expect ( block . cid . multihash ) . to . eql ( multihash . fromB58String ( expectedHash ) )
46
46
} )
47
47
48
+ it ( 'should put a buffer, using CID string' , async ( ) => {
49
+ const expectedCid = 'bafyreietui4xdkiu4xvmx4fi2jivjtndbhb4drzpxomrjvd4mdz4w2avra'
50
+ const blob = Buffer . from ( JSON . stringify ( { hello : 'world' } ) )
51
+
52
+ const block = await ipfs . block . put ( blob , { cid : expectedCid } )
53
+
54
+ expect ( block . data ) . to . be . eql ( blob )
55
+ expect ( block . cid . toString ( ) ) . to . eql ( expectedCid )
56
+ } )
57
+
48
58
it ( 'should put a buffer, using options' , async ( ) => {
49
59
const blob = Buffer . from ( `TEST${ Date . now ( ) } ` )
50
60
You can’t perform that action at this time.
0 commit comments