diff --git a/packages/sequencer/src/protocol/production/sequencing/BlockProducerModule.ts b/packages/sequencer/src/protocol/production/sequencing/BlockProducerModule.ts index e98447d4..e245b239 100644 --- a/packages/sequencer/src/protocol/production/sequencing/BlockProducerModule.ts +++ b/packages/sequencer/src/protocol/production/sequencing/BlockProducerModule.ts @@ -1,5 +1,5 @@ import { inject } from "tsyringe"; -import { log, noop } from "@proto-kit/common"; +import { log } from "@proto-kit/common"; import { ACTIONS_EMPTY_HASH } from "@proto-kit/protocol"; import { MethodIdResolver, diff --git a/packages/sequencer/test/integration/BlockProduction.test.ts b/packages/sequencer/test/integration/BlockProduction.test.ts index f411bdbf..e94048d0 100644 --- a/packages/sequencer/test/integration/BlockProduction.test.ts +++ b/packages/sequencer/test/integration/BlockProduction.test.ts @@ -1,4 +1,4 @@ -import { log, range, MOCK_PROOF } from "@proto-kit/common"; +import { log, range, MOCK_PROOF, expectDefined } from "@proto-kit/common"; import { VanillaProtocolModules } from "@proto-kit/library"; import { Runtime, @@ -168,7 +168,7 @@ describe("block production", () => { }); it("should produce a dummy block proof", async () => { - expect.assertions(25); + expect.assertions(27); log.setLevel("TRACE"); @@ -199,7 +199,7 @@ describe("block production", () => { const latestBlockWithResult = await sequencer .resolve("BlockQueue") - .getLatestBlock(); + .getLatestBlockAndResult(); let batch = await blockTrigger.produceBatch(); @@ -208,8 +208,10 @@ describe("block production", () => { expect(batch!.blockHashes).toHaveLength(1); expect(batch!.proof.proof).toBe(MOCK_PROOF); + expectDefined(latestBlockWithResult); + expectDefined(latestBlockWithResult.result); expect( - latestBlockWithResult!.result.afterNetworkState.hash().toString() + latestBlockWithResult.result.afterNetworkState.hash().toString() ).toStrictEqual(batch!.toNetworkState.hash().toString()); // Check if the batchstorage has received the block diff --git a/packages/sequencer/test/settlement/Settlement.ts b/packages/sequencer/test/settlement/Settlement.ts index 7735552f..75b9e244 100644 --- a/packages/sequencer/test/settlement/Settlement.ts +++ b/packages/sequencer/test/settlement/Settlement.ts @@ -1,5 +1,10 @@ /* eslint-disable no-inner-declarations */ -import { log, mapSequential, RollupMerkleTree } from "@proto-kit/common"; +import { + expectDefined, + log, + mapSequential, + RollupMerkleTree, +} from "@proto-kit/common"; import { VanillaProtocolModules } from "@proto-kit/library"; import { Runtime } from "@proto-kit/module"; import { @@ -277,7 +282,7 @@ export const settlementTestFn = ( RollupMerkleTree.EMPTY_ROOT ); - const lastBlock = await blockQueue.getLatestBlock(); + const lastBlock = await blockQueue.getLatestBlockAndResult(); await trigger.settle(batch!); nonceCounter++; @@ -287,14 +292,16 @@ export const settlementTestFn = ( console.log("Block settled"); const { settlement } = settlementModule.getContracts(); + expectDefined(lastBlock); + expectDefined(lastBlock.result); expect(settlement.networkStateHash.get().toBigInt()).toStrictEqual( - lastBlock!.result.afterNetworkState.hash().toBigInt() + lastBlock.result.afterNetworkState.hash().toBigInt() ); expect(settlement.stateRoot.get().toBigInt()).toStrictEqual( - lastBlock!.result.stateRoot + lastBlock.result.stateRoot ); expect(settlement.blockHashRoot.get().toBigInt()).toStrictEqual( - lastBlock!.result.blockHashRoot + lastBlock.result.blockHashRoot ); }, timeout