Skip to content

Commit

Permalink
Fix types
Browse files Browse the repository at this point in the history
  • Loading branch information
dapplion committed Nov 26, 2022
1 parent 0216099 commit 22d1f85
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
7 changes: 4 additions & 3 deletions packages/beacon-node/test/sim/merge-interop.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ import {Context} from "mocha";
import {fromHexString} from "@chainsafe/ssz";
import {isExecutionStateType, isMergeTransitionComplete} from "@lodestar/state-transition";
import {LogLevel, sleep, TimestampFormatCode} from "@lodestar/utils";
import {SLOTS_PER_EPOCH} from "@lodestar/params";
import {ForkName, SLOTS_PER_EPOCH} from "@lodestar/params";
import {IChainConfig} from "@lodestar/config";
import {Epoch} from "@lodestar/types";
import {ValidatorProposerConfig} from "@lodestar/validator";

import {ExecutePayloadStatus} from "../../src/execution/engine/interface.js";
import {ExecutePayloadStatus, PayloadAttributes} from "../../src/execution/engine/interface.js";
import {ExecutionEngineHttp} from "../../src/execution/engine/http.js";
import {ChainEvent} from "../../src/chain/index.js";
import {testLogger, TestLoggerOpts} from "../utils/logger.js";
Expand Down Expand Up @@ -118,11 +118,12 @@ describe("executionEngine / ExecutionEngineHttp", function () {
* curl -X POST -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"engine_forkchoiceUpdatedV1","params":[{"headBlockHash":"0x3b8fb240d288781d4aac94d3fd16809ee413bc99294a085798a589dae51ddd4a", "safeBlockHash":"0x3b8fb240d288781d4aac94d3fd16809ee413bc99294a085798a589dae51ddd4a", "finalizedBlockHash":"0x0000000000000000000000000000000000000000000000000000000000000000"}, {"timestamp":"0x5", "prevRandao":"0x0000000000000000000000000000000000000000000000000000000000000000", "feeRecipient":"0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b"}],"id":67}' http://localhost:8550
**/

const preparePayloadParams = {
const preparePayloadParams: PayloadAttributes = {
// Note: this is created with a pre-defined genesis.json
timestamp: quantityToNum("0x5"),
prevRandao: dataToBytes("0x0000000000000000000000000000000000000000000000000000000000000000"),
suggestedFeeRecipient: "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b",
fork: ForkName.bellatrix,
};

const finalizedBlockHash = "0x0000000000000000000000000000000000000000000000000000000000000000";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import {expect} from "chai";
import {fastify} from "fastify";

import {ForkName} from "@lodestar/params";
import {fromHexString} from "@chainsafe/ssz";

import {ExecutionEngineHttp, defaultExecutionEngineHttpOpts} from "../../../src/execution/engine/http.js";

import {bytesToData, numToQuantity} from "../../../src/eth1/provider/utils.js";
import {PayloadAttributes} from "../../../src/execution/index.js";

describe("ExecutionEngine / http ", () => {
const afterCallbacks: (() => Promise<void> | void)[] = [];
Expand Down Expand Up @@ -95,10 +96,11 @@ describe("ExecutionEngine / http ", () => {
safeBlockHash: "0xb084c10440f05f5a23a55d1d7ebcb1b3892935fb56f23cdc9a7f42c348eed174",
finalizedBlockHash: "0xb084c10440f05f5a23a55d1d7ebcb1b3892935fb56f23cdc9a7f42c348eed174",
};
const payloadAttributes = {
const payloadAttributes: PayloadAttributes = {
timestamp: 1647036763,
prevRandao: fromHexString("0x0000000000000000000000000000000000000000000000000000000000000000"),
suggestedFeeRecipient: "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b",
fork: ForkName.bellatrix,
};

const request = {
Expand Down
2 changes: 1 addition & 1 deletion packages/beacon-node/test/utils/block.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {isPlainObject} from "@lodestar/utils";
import {RecursivePartial} from "@lodestar/utils";
import {ContextBytesType, EncodedPayloadType} from "@lodestar/reqresp";
import {EMPTY_SIGNATURE, ZERO_HASH} from "../../src/constants/index.js";
import {ReqRespBlockResponse} from "../../src/network/reqresp/types.js";
import {ReqRespBlockResponse} from "../../src/network/reqresp/index.js";
import {BlockImport} from "../../src/chain/blocks/types.js";

export function toBlockImport(block: allForks.SignedBeaconBlock): BlockImport {
Expand Down

0 comments on commit 22d1f85

Please sign in to comment.