mirror of
https://github.com/codex-storage/nim-codex.git
synced 2025-02-01 15:45:06 +00:00
2396c4d76d
* Blockexchange uses merkle root and index to fetch blocks * Links the network store getTree to the local store. * Update codex/stores/repostore.nim Co-authored-by: Dmitriy Ryajov <dryajov@gmail.com> Signed-off-by: Tomasz Bekas <tomasz.bekas@gmail.com> * Rework erasure.nim to include recent cleanup * Revert accidential changes to lib versions * Addressing review comments * Storing proofs instead of trees * Fix a comment * Fix broken tests * Fix for broken testerasure.nim * Addressing PR comments --------- Signed-off-by: Tomasz Bekas <tomasz.bekas@gmail.com> Co-authored-by: benbierens <thatbenbierens@gmail.com> Co-authored-by: Dmitriy Ryajov <dryajov@gmail.com>
30 lines
571 B
Nim
30 lines
571 B
Nim
import std/sequtils
|
|
|
|
import pkg/chronos
|
|
import pkg/questionable/results
|
|
import pkg/asynctest
|
|
import pkg/stew/byteutils
|
|
|
|
import pkg/codex/chunker
|
|
import pkg/codex/blocktype as bt
|
|
import pkg/codex/manifest
|
|
|
|
import ./helpers
|
|
import ./examples
|
|
|
|
checksuite "Manifest":
|
|
test "Should encode/decode to/from manifest":
|
|
var
|
|
manifest = Manifest.new(
|
|
treeCid = Cid.example,
|
|
blockSize = 1.MiBs,
|
|
datasetSize = 100.MiBs)
|
|
|
|
let
|
|
e = manifest.encode().tryGet()
|
|
decoded = Manifest.decode(e).tryGet()
|
|
|
|
check:
|
|
decoded == manifest
|
|
|