This repository was archived by the owner on Mar 10, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change 4747 "hat" : " 0.0.3" ,
4848 "ipfs-block" : " ~0.8.0" ,
4949 "ipfs-unixfs" : " ^0.3.0" ,
50- "ipfs-utils" : " ^0.6.0 " ,
50+ "ipfs-utils" : " ^0.7.1 " ,
5151 "ipld-dag-cbor" : " ~0.15.0" ,
5252 "ipld-dag-pb" : " ^0.18.1" ,
5353 "is-ipfs" : " ~0.6.1" ,
6464 },
6565 "devDependencies" : {
6666 "aegir" : " ^20.3.2" ,
67- "ipfsd-ctl" : " ^1.0 .0"
67+ "ipfsd-ctl" : " ^2.1 .0"
6868 },
6969 "contributors" : [
7070 " Alan Shaw <alan.shaw@protocol.ai>" ,
Original file line number Diff line number Diff line change @@ -45,6 +45,16 @@ module.exports = (common, options) => {
4545 expect ( block . cid . multihash ) . to . eql ( multihash . fromB58String ( expectedHash ) )
4646 } )
4747
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+
4858 it ( 'should put a buffer, using options' , async ( ) => {
4959 const blob = Buffer . from ( `TEST${ Date . now ( ) } ` )
5060
You can’t perform that action at this time.
0 commit comments