Skip to content

Commit

Permalink
Fix spec tests
Browse files Browse the repository at this point in the history
  • Loading branch information
nazarhussain committed Jan 12, 2024
1 parent 84b174c commit c59ab70
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/beacon-node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
"download-spec-tests": "node --loader=ts-node/esm test/spec/downloadTests.ts",
"test:spec:bls": "vitest --run --config vitest.config.spec.ts --dir test/spec/bls/",
"test:spec:general": "vitest --run --config vitest.config.spec.ts --dir test/spec/general/",
"test:spec:minimal": "LODESTAR_PRESET=minimal vitest --run --config vitest.config.spec.ts --dir test/spec/presets/",
"test:spec:minimal": "LODESTAR_PRESET=minimal vitest --run --passWithNoTests --config vitest.config.spec.ts --dir test/spec/presets/",
"test:spec:mainnet": "LODESTAR_PRESET=mainnet vitest --run --config vitest.config.spec.ts --dir test/spec/presets/",
"test:spec": "yarn test:spec:bls && yarn test:spec:general && yarn test:spec:minimal && yarn test:spec:mainnet",
"check-readme": "typescript-docs-verifier"
Expand Down
5 changes: 4 additions & 1 deletion packages/beacon-node/test/spec/presets/fork_choice.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {phase0, allForks, bellatrix, ssz, RootHex, deneb} from "@lodestar/types"
import {bnToNum, fromHex} from "@lodestar/utils";
import {createBeaconConfig} from "@lodestar/config";
import {ACTIVE_PRESET, ForkSeq, isForkBlobs} from "@lodestar/params";
import {BeaconChain} from "../../../src/chain/index.js";
import {BeaconChain, ChainEvent} from "../../../src/chain/index.js";
import {ClockEvent} from "../../../src/util/clock.js";
import {computeInclusionProof} from "../../../src/util/blobs.js";
import {createCachedBeaconStateTest} from "../../utils/cachedBeaconState.js";
Expand Down Expand Up @@ -112,6 +112,9 @@ const forkChoiceTest =
}
);

// The handler of `ChainEvent.forkChoiceFinalized` access `db.block` and raise error if not found.
chain.emitter.removeAllListeners(ChainEvent.forkChoiceFinalized);

const stepsLen = steps.length;
logger.debug("Fork choice test", {steps: stepsLen});

Expand Down

0 comments on commit c59ab70

Please sign in to comment.