Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
g11tech committed Dec 2, 2023
1 parent 45e9fc0 commit 0cd4e7e
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions packages/validator/test/unit/services/block.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {createChainForkConfig} from "@lodestar/config";
import {config as mainnetConfig} from "@lodestar/config/default";
import {sleep} from "@lodestar/utils";
import {ssz} from "@lodestar/types";
import {HttpStatusCode} from "@lodestar/api";
import {HttpStatusCode, routes} from "@lodestar/api";
import {ForkName} from "@lodestar/params";
import {BlockProposingService} from "../../../src/services/block.js";
import {ValidatorStore} from "../../../src/services/validatorStore.js";
Expand Down Expand Up @@ -52,7 +52,7 @@ describe("BlockDutiesService", function () {
// use produceBlockV3
const blockService = new BlockProposingService(config, loggerVc, api, clock, validatorStore, null, {
useProduceBlockV3: true,
broadcastValidation: "consensus",
broadcastValidation: routes.beacon.BroadcastValidation.consensus,
});

const signedBlock = ssz.phase0.SignedBeaconBlock.defaultValue();
Expand All @@ -79,6 +79,9 @@ describe("BlockDutiesService", function () {

// Must have submitted the block received on signBlock()
expect(api.beacon.publishBlockV2.callCount).to.equal(1, "publishBlock() must be called once");
expect(api.beacon.publishBlockV2.getCall(0).args).to.deep.equal([signedBlock], "wrong publishBlock() args");
expect(api.beacon.publishBlockV2.getCall(0).args).to.deep.equal(
[signedBlock, {broadcastValidation: routes.beacon.BroadcastValidation.consensus}],
"wrong publishBlock() args"
);
});
});

0 comments on commit 0cd4e7e

Please sign in to comment.