Minor cleanup and update deps (#42)

* abort download if atleast one block failed

* make chunker a regular object

* updating questionable

* updating vendor deps

* cleanup unused imports

* Remove mention of Waku
This commit is contained in:
Dmitriy Ryajov 2022-01-12 16:19:37 -06:00 committed by GitHub
parent 15ef6c78eb
commit 2188f69273
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
18 changed files with 10 additions and 28 deletions

View File

@ -33,5 +33,5 @@ proc test(name: string, params = "-d:chronicles_log_level=DEBUG", lang = "c") =
buildBinary name, "tests/", params
exec "build/" & name
task testAll, "Build & run Waku v1 tests":
task testAll, "Build & run Dagger tests":
test "testAll", "-d:chronicles_log_level=WARN"

View File

@ -12,7 +12,6 @@ import std/sequtils
import pkg/chronos
import pkg/chronicles
import pkg/libp2p
import pkg/libp2p/errors
import ../stores/blockstore
import ../blocktype as bt

View File

@ -34,7 +34,7 @@ type
FixedChunker
RabinChunker
Chunker* = ref object
Chunker* = object
reader*: Reader
case kind*: ChunkerType:
of FixedChunker:

View File

@ -72,8 +72,8 @@ proc streamBlocks*(
# since disk IO is blocking
for c in blockManifest:
without blk =? (await node.blockStore.getBlock(c)):
trace "Couldn't retrieve block", cid = c
continue
warn "Couldn't retrieve block", cid = c
break # abort if we couldn't get a block
trace "Streaming block data", cid = blk.cid, bytes = blk.data.len
await stream.pushData(blk.data)

View File

@ -20,8 +20,6 @@ export blocktype, libp2p
type
BlockStore* = ref object of RootObj
{.push locks:"unknown".}
method getBlock*(
b: BlockStore,
cid: Cid): Future[?!Block] {.base.} =
@ -46,8 +44,6 @@ method delBlock*(
doAssert(false, "Not implemented!")
{.pop.}
method hasBlock*(s: BlockStore, cid: Cid): bool {.base.} =
## Check if the block exists in the blockstore
##

View File

@ -96,8 +96,6 @@ method delBlock*(
return true
{.pop.}
method hasBlock*(self: FSStore, cid: Cid): bool =
## Check if the block exists in the blockstore
##

View File

@ -12,7 +12,6 @@
import pkg/chronicles
import pkg/chronos
import pkg/libp2p
import pkg/libp2p/errors
import ../blocktype as bt
import ../utils/asyncheapqueue

View File

@ -5,7 +5,6 @@ import pkg/stew/byteutils
import pkg/asynctest
import pkg/chronos
import pkg/libp2p
import pkg/libp2p/errors
import pkg/dagger/rng
import pkg/dagger/blockexchange

View File

@ -5,8 +5,6 @@ import pkg/asynctest
import pkg/chronos
import pkg/libp2p
import pkg/libp2p/errors
import questionable
import questionable/results
import pkg/protobuf_serialization
import pkg/dagger/rng

View File

@ -1,10 +1,5 @@
import pkg/libp2p/varint
import pkg/dagger/blocktype
import pkg/questionable
import pkg/questionable/results
import ./helpers/nodeutils
import ./helpers/randomchunker

View File

@ -2,7 +2,6 @@ import pkg/chronos
import pkg/asynctest
import pkg/libp2p
import pkg/stew/byteutils
import pkg/questionable
import pkg/questionable/results
import pkg/dagger/stores/memorystore
import pkg/dagger/chunker

View File

@ -7,7 +7,6 @@ import pkg/stew/byteutils
import pkg/nitro
import pkg/libp2p
import pkg/libp2p/errors
import pkg/dagger/stores
import pkg/dagger/blockexchange

@ -1 +1 @@
Subproject commit 32e72c2fc97633d84e539ca1cced213dd0841b5a
Subproject commit 1682096306ddba8185dcfac360a8c3f952d721e4

2
vendor/nim-chronos vendored

@ -1 +1 @@
Subproject commit 7dc58d42b6905a7fd7531875fa76060f8f744e4e
Subproject commit 17fed89c99beac5a92d3668d0d3e9b0e4ac13936

@ -1 +1 @@
Subproject commit ab4ba1cbfdccdb8c0398894ffc25169bc61faeed
Subproject commit 0435e67832b6bb8dfdf0ddb102903e9d820206d2

2
vendor/nim-libp2p vendored

@ -1 +1 @@
Subproject commit 58f383e661521314df314e7096c24db5a7490372
Subproject commit e72d03bc78d3bc896ae5912ab45e2ecd53849aa5

2
vendor/nim-presto vendored

@ -1 +1 @@
Subproject commit c41bc8aefc7e5342eb927f874140b80d0e989a95
Subproject commit 962bb588d19c7180e39f0d9f18131e75861bab20

2
vendor/questionable vendored

@ -1 +1 @@
Subproject commit 54516fd2d1afb9ac556099c061ec60aa201cae74
Subproject commit 6018fd43e033d5a5310faa45bcaa1b44049469a4