Skip to content

Commit

Permalink
lint and tsc fix
Browse files Browse the repository at this point in the history
  • Loading branch information
g11tech committed Apr 11, 2024
1 parent 3a68ce9 commit 422f2bc
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 8 deletions.
9 changes: 5 additions & 4 deletions packages/beacon-node/test/sim/electra-interop.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import fs from "node:fs";
import {describe, it, vi, afterAll, afterEach} from "vitest";
/* eslint-disable @typescript-eslint/naming-convention */
import _ from "lodash";
import {describe, it, vi, afterAll, afterEach, assert} from "vitest";
import {LogLevel, sleep} from "@lodestar/utils";
import {ForkName, SLOTS_PER_EPOCH, UNSET_DEPOSIT_RECEIPTS_START_INDEX} from "@lodestar/params";
import {electra, Epoch, Slot} from "@lodestar/types";
Expand Down Expand Up @@ -173,6 +171,7 @@ describe("executionEngine / ExecutionEngineHttp", function () {
blockHash: dataToBytes(newPayloadBlockHash, 32),
receiptsRoot: dataToBytes("0x79ee3424eb720a3ad4b1c5a372bb8160580cbe4d893778660f34213c685627a9", 32),
blobGasUsed: 0n,
exits: [],
};
const parentBeaconBlockRoot = dataToBytes("0x0000000000000000000000000000000000000000000000000000000000000000", 32);
const payloadResult = await executionEngine.notifyNewPayload(
Expand Down Expand Up @@ -225,7 +224,9 @@ describe("executionEngine / ExecutionEngineHttp", function () {
}

const actualDepositReceipt = payload.depositReceipts[0];
if (!_.isEqual(actualDepositReceipt, depositReceiptB)) {
try {
assert.deepEqual(actualDepositReceipt, depositReceiptB);
} catch (error) {
throw Error(
`Deposit receipts mismatched. Expected: ${JSON.stringify(depositReceiptB)}, actual: ${JSON.stringify(
actualDepositReceipt
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,10 @@ describe("chain / rewards / blockRewards", () => {
// Populate tree root caches of the state
state.hashTreeRoot();
cachedStateAltairPopulateCaches(state);
const calculatedBlockReward = await computeBlockRewards(block.message, state as CachedBeaconStateAllForks);
const calculatedBlockReward = await computeBlockRewards(
block.message,
state as unknown as CachedBeaconStateAllForks
);
const {proposerIndex, total, attestations, syncAggregate, proposerSlashings, attesterSlashings} =
calculatedBlockReward;

Expand All @@ -109,7 +112,7 @@ describe("chain / rewards / blockRewards", () => {
expect(attesterSlashings).toBe(0);
}

const postState = stateTransition(state as CachedBeaconStateAllForks, block, {
const postState = stateTransition(state as unknown as CachedBeaconStateAllForks, block, {
executionPayloadStatus: ExecutionPayloadStatus.valid,
dataAvailableStatus: DataAvailableStatus.available,
verifyProposer: false,
Expand Down Expand Up @@ -137,7 +140,7 @@ describe("chain / rewards / blockRewards", () => {
preState.hashTreeRoot();
cachedStateAltairPopulateCaches(preState);

const postState = stateTransition(preState as CachedBeaconStateAllForks, block, {
const postState = stateTransition(preState as unknown as CachedBeaconStateAllForks, block, {
executionPayloadStatus: ExecutionPayloadStatus.valid,
dataAvailableStatus: DataAvailableStatus.available,
verifyProposer: false,
Expand All @@ -151,7 +154,7 @@ describe("chain / rewards / blockRewards", () => {

const calculatedBlockReward = await computeBlockRewards(
block.message,
preState as CachedBeaconStateAllForks,
preState as unknown as CachedBeaconStateAllForks,
postState
);
const {proposerIndex, total, attestations, syncAggregate, proposerSlashings, attesterSlashings} =
Expand Down
4 changes: 4 additions & 0 deletions packages/beacon-node/test/unit/executionEngine/http.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ describe("ExecutionEngine / http", () => {
},
],
depositReceipts: null, // depositReceipts is null pre-electra
exits: null,
},
null, // null returned for missing blocks
{
Expand All @@ -198,6 +199,7 @@ describe("ExecutionEngine / http", () => {
],
withdrawals: null, // withdrawals is null pre-capella
depositReceipts: null, // depositReceipts is null pre-electra
exits: null,
},
],
};
Expand Down Expand Up @@ -246,6 +248,7 @@ describe("ExecutionEngine / http", () => {
},
],
depositReceipts: null, // depositReceipts is null pre-electra
exits: null,
},
null, // null returned for missing blocks
{
Expand All @@ -255,6 +258,7 @@ describe("ExecutionEngine / http", () => {
],
withdrawals: null, // withdrawals is null pre-capella
depositReceipts: null, // depositReceipts is null pre-electra
exits: null,
},
],
};
Expand Down

0 comments on commit 422f2bc

Please sign in to comment.