fix macos compilation error

This commit is contained in:
Eric 2024-10-31 11:39:05 +11:00
parent 1bc915ea49
commit 8aaff32b46
No known key found for this signature in database
2 changed files with 4 additions and 4 deletions

View File

@ -84,8 +84,8 @@ proc init*(
var var
self = Poseidon2Tree(compress: compressor, zero: Poseidon2Zero) self = Poseidon2Tree(compress: compressor, zero: Poseidon2Zero)
without l =? (await merkleTreeWorker(self, leaves, isBottomLayer = true)), err: without l =? (await merkleTreeWorker(self, leaves, isBottomLayer = true)), error:
return failure err return failure error
self.layers = l self.layers = l
success self success self

View File

@ -51,8 +51,8 @@ proc digestTree*(
while index < bytes.len: while index < bytes.len:
let start = index let start = index
let finish = min(index + chunkSize, bytes.len) let finish = min(index + chunkSize, bytes.len)
without digest =? Poseidon2Hash.spongeDigest(bytes.toOpenArray(start, finish - 1), 2), err: without digest =? Poseidon2Hash.spongeDigest(bytes.toOpenArray(start, finish - 1), 2), error:
return failure err return failure error
leaves.add(digest) leaves.add(digest)
index += chunkSize index += chunkSize
await sleepAsync(1.nanos) # cooperative scheduling await sleepAsync(1.nanos) # cooperative scheduling