Skip to content

Commit

Permalink
fix: beaconBlocksMaybeBlobsByRange.test.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
twoeths committed Jun 19, 2023
1 parent 2e0d760 commit 0b00a84
Showing 1 changed file with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {createBeaconConfig, createChainForkConfig, defaultChainConfig} from "@lo
import {BYTES_PER_FIELD_ELEMENT} from "@lodestar/params";

import {beaconBlocksMaybeBlobsByRange} from "../../../src/network/reqresp/index.js";
import {BlockInputType, BlockSource, blobSidecarsToBlobsSidecar} from "../../../src/chain/blocks/types.js";
import {BlockInput, BlockInputType, BlockSource, blobSidecarsToBlobsSidecar} from "../../../src/chain/blocks/types.js";
import {ckzg, initCKZG, loadEthereumTrustedSetup, FIELD_ELEMENTS_PER_BLOB_MAINNET} from "../../../src/util/kzg.js";
import {INetwork} from "../../../src/network/interface.js";
import {ZERO_HASH} from "../../../src/constants/constants.js";
Expand Down Expand Up @@ -89,7 +89,7 @@ describe("beaconBlocksMaybeBlobsByRange", () => {
.filter((blobs) => blobs !== undefined)
.reduce((acc, elem) => acc.concat(elem), []);

const expectedResponse = blocksWithBlobs.map(([block, blobSidecars]) => {
const expectedResponse: BlockInput[] = blocksWithBlobs.map(([block, blobSidecars]) => {
const blobs = (blobSidecars !== undefined ? blobSidecars : []).map((bscar) => {
// TODO DENEB: cleanup the following generation as its not required to generate
// proper field elements for the aggregate proofs compute
Expand All @@ -104,11 +104,16 @@ describe("beaconBlocksMaybeBlobsByRange", () => {
source: BlockSource.byRange,
// TODO DENEB: Cleanup the conversion once migration complete
blobs: blobSidecarsToBlobsSidecar(chainConfig, block, blobs),
blockBytes: null,
};
});

const network = {
sendBeaconBlocksByRange: async () => blocks.map((data) => ({data, bytes: ZERO_HASH})),
sendBeaconBlocksByRange: async () =>
blocks.map((data) => ({
data,
bytes: ZERO_HASH,
})),
sendBlobSidecarsByRange: async () => blobSidecars,
} as Partial<INetwork> as INetwork;

Expand Down

0 comments on commit 0b00a84

Please sign in to comment.