logos-storage-nim/tests/codex/helpers/mockblockstore.nim
2023-06-15 08:19:20 +02:00

14 lines
342 B
Nim

import pkg/chronos
import pkg/libp2p
import pkg/questionable/results
import pkg/codex/stores/blockstore
type
MockBlockStore* = ref object of BlockStore
numberOfGetCalls*: int
getBlock*: Block
method getBlock*(self: MockBlockStore, cid: Cid): Future[?!Block] {.async.} =
inc self.numberOfGetCalls
return success(self.getBlock)