diff --git a/tests/codex/node/testcontracts.nim b/tests/codex/node/testcontracts.nim index a3a2dc85..df80a3fc 100644 --- a/tests/codex/node/testcontracts.nim +++ b/tests/codex/node/testcontracts.nim @@ -91,12 +91,13 @@ asyncchecksuite "Test Node - Host contracts": protected = (await erasure.encode(manifest, 3, 2)).tryGet() builder = Poseidon2Builder.new(localStore, protected).tryGet() + (await builder.init()).tryGet() + verifiable = (await builder.buildManifest()).tryGet() verifiableBlock = bt.Block.new( verifiable.encode().tryGet(), codec = ManifestCodec).tryGet() - (await builder.init()).tryGet() (await localStore.putBlock(verifiableBlock)).tryGet() test "onExpiryUpdate callback is set": diff --git a/tests/codex/slots/testslotbuilder.nim b/tests/codex/slots/testslotbuilder.nim index 93ab7ec9..1fd7c01e 100644 --- a/tests/codex/slots/testslotbuilder.nim +++ b/tests/codex/slots/testslotbuilder.nim @@ -158,11 +158,16 @@ suite "Slot builder": Poseidon2Builder.new(localStore, mismatchManifest, cellSize = cellSize) .error.msg == "Block size must be divisable by cell size." + proc createPoseidon2Builder(): Future[Poseidon2Builder] {.async.} = + let builder = Poseidon2Builder.new( + localStore, + protectedManifest, + cellSize = cellSize).tryGet() + (await builder.init()).tryGet() + builder + test "Should build correct slot builder": - builder = Poseidon2Builder.new( - localStore, - protectedManifest, - cellSize = cellSize).tryGet() + builder = await createPoseidon2Builder() check: builder.cellSize == cellSize @@ -177,10 +182,7 @@ suite "Slot builder": steppedStrategy = Strategy.init( 0, numBlocksTotal - 1, numSlots) - builder = Poseidon2Builder.new( - localStore, - protectedManifest, - cellSize = cellSize).tryGet() + builder = await createPoseidon2Builder() for i in 0..