This repository was archived by the owner on Aug 11, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +13
-18
lines changed Expand file tree Collapse file tree 2 files changed +13
-18
lines changed Original file line number Diff line number Diff line change 4141 "chai" : " ^3.5.0" ,
4242 "fs-pull-blob-store" : " ^0.4.1" ,
4343 "idb-pull-blob-store" : " ^0.5.1" ,
44- "ipfs-block" : " ^0.5.3 " ,
44+ "ipfs-block" : " ^0.5.4 " ,
4545 "ipfs-repo" : " ^0.11.2" ,
4646 "lodash" : " ^4.17.2" ,
4747 "ncp" : " ^2.0.0" ,
6464 " npmcdn-to-unpkg-bot <[email protected] >" ,
65656666 ]
67- }
67+ }
Original file line number Diff line number Diff line change @@ -44,24 +44,19 @@ module.exports = class BlockService {
4444 }
4545
4646 putStream ( ) {
47- let ps
4847 if ( this . isOnline ( ) ) {
49- // NOTE: This will have to change in order for bitswap
50- // to understand CID
51- ps = this . _bitswap . putStream ( )
48+ return this . _bitswap . putStream ( )
5249 } else {
53- ps = this . _repo . blockstore . putStream ( )
50+ return pull (
51+ pull . map ( ( blockAndCID ) => {
52+ return {
53+ data : blockAndCID . block . data ,
54+ key : blockAndCID . cid . multihash
55+ }
56+ } ) ,
57+ this . _repo . blockstore . putStream ( )
58+ )
5459 }
55-
56- return pull (
57- pull . map ( ( blockAndCID ) => {
58- return {
59- data : blockAndCID . block . data ,
60- key : blockAndCID . cid . multihash
61- }
62- } ) ,
63- ps
64- )
6560 }
6661
6762 get ( cid , callback ) {
@@ -78,7 +73,7 @@ module.exports = class BlockService {
7873
7974 getStream ( cid ) {
8075 if ( this . isOnline ( ) ) {
81- return this . _bitswap . getStream ( cid . multihash )
76+ return this . _bitswap . getStream ( cid )
8277 }
8378
8479 return this . _repo . blockstore . getStream ( cid . multihash )
You can’t perform that action at this time.
0 commit comments