Skip to content

Commit

Permalink
Fixed linting
Browse files Browse the repository at this point in the history
  • Loading branch information
rpanic committed Nov 22, 2024
1 parent cd20842 commit fc03133
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 10 deletions.
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
10 changes: 6 additions & 4 deletions packages/sequencer/test/integration/BlockProduction.test.ts
Original file line number Diff line number Diff line change
@@ -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,
Expand Down Expand Up @@ -168,7 +168,7 @@ describe("block production", () => {
});

it("should produce a dummy block proof", async () => {
expect.assertions(25);
expect.assertions(27);

log.setLevel("TRACE");

Expand Down Expand Up @@ -199,7 +199,7 @@ describe("block production", () => {

const latestBlockWithResult = await sequencer
.resolve("BlockQueue")
.getLatestBlock();
.getLatestBlockAndResult();

let batch = await blockTrigger.produceBatch();

Expand All @@ -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
Expand Down
17 changes: 12 additions & 5 deletions packages/sequencer/test/settlement/Settlement.ts
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down Expand Up @@ -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++;
Expand All @@ -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
Expand Down

0 comments on commit fc03133

Please sign in to comment.