这是indexloc提供的服务,不要输入任何密码
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
import path from "node:path";
import {expect} from "vitest";
import {Tree} from "@chainsafe/persistent-merkle-tree";
import {ACTIVE_PRESET, ForkAll} from "@lodestar/params";
import {ACTIVE_PRESET} from "@lodestar/params";
import {InputType} from "@lodestar/spec-test-util";
import {BeaconBlockBody, SSZTypesFor, ssz} from "@lodestar/types";
import {BeaconBlockBody, sszTypesFor} from "@lodestar/types";
import {toHex} from "@lodestar/utils";
import {ethereumConsensusSpecsTests} from "../specTestVersioning.js";
import {specTestIterator} from "../utils/specTestIterator.js";
import {RunnerType, TestRunnerFn} from "../utils/types.js";

const merkle: TestRunnerFn<MerkleTestCase, string[]> = (fork) => {
const merkleProof: TestRunnerFn<MerkleTestCase, string[]> = (fork) => {
return {
testFunction: (testcase) => {
const bodyView = (ssz[fork].BeaconBlockBody as SSZTypesFor<ForkAll, "BeaconBlockBody">).toView(testcase.object);
const bodyView = sszTypesFor(fork).BeaconBlockBody.toView(testcase.object);
const branch = new Tree(bodyView.node).getSingleProof(testcase.proof.leaf_index);
return branch.map(toHex);
},
Expand All @@ -22,7 +22,7 @@ const merkle: TestRunnerFn<MerkleTestCase, string[]> = (fork) => {
proof: InputType.YAML,
},
getSszTypes: () => ({
object: ssz[fork].BeaconBlockBody,
object: sszTypesFor(fork).BeaconBlockBody,
}),
timeout: 10000,
shouldSkip: (_testCase, name) => {
Expand Down Expand Up @@ -51,5 +51,5 @@ interface IProof {
}

specTestIterator(path.join(ethereumConsensusSpecsTests.outputDir, "tests", ACTIVE_PRESET), {
merkle_proof: {type: RunnerType.default, fn: merkle},
merkle_proof: {type: RunnerType.default, fn: merkleProof},
});
2 changes: 1 addition & 1 deletion packages/beacon-node/test/spec/utils/specTestIterator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ const coveredTestRunners = [
// ],
// ```
export const defaultSkipOpts: SkipOpts = {
skippedForks: ["eip7594", "eip7732", "eip7805", "gloas"],
skippedForks: ["eip7732", "eip7805", "gloas"],
// TODO: capella
// BeaconBlockBody proof in lightclient is the new addition in v1.3.0-rc.2-hotfix
// Skip them for now to enable subsequently
Expand Down
Loading