fixes compilation
This commit is contained in:
parent
599a5220b3
commit
c5607206de
|
@ -33,7 +33,6 @@ func spongeDigest*(
|
|||
|
||||
success Sponge.digest(bytes, rate)
|
||||
|
||||
# TODO: replace with poseidon2 library call plz
|
||||
proc digestTree*(
|
||||
_: type Poseidon2Tree,
|
||||
bytes: seq[byte],
|
||||
|
|
|
@ -4,6 +4,7 @@ import std/random
|
|||
|
||||
import pkg/constantine/math/arithmetic
|
||||
|
||||
import pkg/chronos
|
||||
import pkg/poseidon2
|
||||
import pkg/poseidon2/io
|
||||
import pkg/poseidon2/sponge
|
||||
|
@ -30,9 +31,9 @@ suite "Digest - MerkleTree":
|
|||
leaves.add(digest)
|
||||
|
||||
let
|
||||
digest = Poseidon2Tree.digest(bytes, chunkSize = 2*KB).tryGet
|
||||
digest = (waitFor Poseidon2Tree.digest(bytes, chunkSize = 2*KB)).tryGet
|
||||
spongeDigest = SpongeMerkle.digest(bytes, chunkSize = 2*KB)
|
||||
codexPosTree = Poseidon2Tree.init(leaves).tryGet
|
||||
codexPosTree = (waitFor Poseidon2Tree.init(leaves)).tryGet
|
||||
rootDigest = codexPosTree.root.tryGet
|
||||
|
||||
check:
|
||||
|
@ -53,9 +54,9 @@ suite "Digest - MerkleTree":
|
|||
leaves.add(Sponge.digest(partialChunk, rate = 2))
|
||||
|
||||
let
|
||||
digest = Poseidon2Tree.digest(bytes, chunkSize = 2*KB).tryGet
|
||||
digest = (waitFor Poseidon2Tree.digest(bytes, chunkSize = 2*KB)).tryGet
|
||||
spongeDigest = SpongeMerkle.digest(bytes, chunkSize = 2*KB)
|
||||
codexPosTree = Poseidon2Tree.init(leaves).tryGet
|
||||
codexPosTree = (waitFor Poseidon2Tree.init(leaves)).tryGet
|
||||
rootDigest = codexPosTree.root.tryGet
|
||||
|
||||
check:
|
||||
|
|
|
@ -39,7 +39,7 @@ proc makeManifest*(
|
|||
store: BlockStore,
|
||||
hcodec = Sha256HashCodec,
|
||||
dataCodec = BlockCodec): Future[?!Manifest] {.async.} =
|
||||
without tree =? CodexTree.init(cids), err:
|
||||
without tree =? (await CodexTree.init(cids)), err:
|
||||
return failure(err)
|
||||
|
||||
without treeCid =? tree.rootCid(CIDv1, dataCodec), err:
|
||||
|
@ -90,10 +90,10 @@ proc createProtectedManifest*(
|
|||
|
||||
let
|
||||
cids = datasetBlocks.mapIt(it.cid)
|
||||
datasetTree = CodexTree.init(cids[0..<numDatasetBlocks]).tryGet()
|
||||
datasetTree = (await CodexTree.init(cids[0..<numDatasetBlocks])).tryGet()
|
||||
datasetTreeCid = datasetTree.rootCid().tryGet()
|
||||
|
||||
protectedTree = CodexTree.init(cids).tryGet()
|
||||
protectedTree = (await CodexTree.init(cids)).tryGet()
|
||||
protectedTreeCid = protectedTree.rootCid().tryGet()
|
||||
|
||||
for index, cid in cids[0..<numDatasetBlocks]:
|
||||
|
|
|
@ -269,7 +269,7 @@ suite "Slot builder":
|
|||
Merkle.digest(slotHashes)
|
||||
|
||||
expectedRoot = Merkle.digest(slotsHashes)
|
||||
rootHash = builder.buildVerifyTree(builder.slotRoots).tryGet().root.tryGet()
|
||||
rootHash = (await builder.buildVerifyTree(builder.slotRoots)).tryGet().root.tryGet()
|
||||
|
||||
check:
|
||||
expectedRoot == rootHash
|
||||
|
|
Loading…
Reference in New Issue