Fixes node/testnode.nim
This commit is contained in:
parent
c5607206de
commit
9f94536f13
|
@ -150,8 +150,7 @@ proc merkleTreeWorker*[H, K](
|
|||
without y =? self.compress( xs[a + 2 * i], xs[a + 2 * i + 1], key = key ), err:
|
||||
return failure err
|
||||
ys[i] = y
|
||||
# yield?
|
||||
await sleepAsync(1.millis) # cooperative scheduling (may not be necessary)
|
||||
await sleepAsync(1.micros) # cooperative scheduling
|
||||
if isOdd:
|
||||
const key = when isBottomLayer: K.KeyOddAndBottomLayer else: K.KeyOdd
|
||||
without y =? self.compress( xs[n], self.zero, key = key ), err:
|
||||
|
|
|
@ -325,6 +325,7 @@ proc init*[T, H](self: SlotsBuilder[T, H]): Future[?!void] {.async.} =
|
|||
self.verifiableTree = some tree
|
||||
|
||||
trace "Slots builder initialized"
|
||||
success()
|
||||
|
||||
proc new*[T, H](
|
||||
_: type SlotsBuilder[T, H],
|
||||
|
|
|
@ -55,7 +55,7 @@ proc digestTree*(
|
|||
return failure err
|
||||
leaves.add(digest)
|
||||
index += chunkSize
|
||||
await sleepAsync(1.millis) # cooperative scheduling (may not be necessary)
|
||||
await sleepAsync(1.micros) # cooperative scheduling
|
||||
return await Poseidon2Tree.init(leaves)
|
||||
|
||||
proc digest*(
|
||||
|
|
|
@ -148,12 +148,15 @@ asyncchecksuite "Test Node - Basic":
|
|||
codec = ManifestCodec).tryGet()
|
||||
protected = (await erasure.encode(manifest, 3, 2)).tryGet()
|
||||
builder = Poseidon2Builder.new(localStore, protected).tryGet()
|
||||
|
||||
(await builder.init()).tryGet()
|
||||
|
||||
let
|
||||
verifiable = (await builder.buildManifest()).tryGet()
|
||||
verifiableBlock = bt.Block.new(
|
||||
verifiable.encode().tryGet(),
|
||||
codec = ManifestCodec).tryGet()
|
||||
|
||||
(await builder.init()).tryGet()
|
||||
(await localStore.putBlock(manifestBlock)).tryGet()
|
||||
|
||||
let
|
||||
|
|
Loading…
Reference in New Issue