UNPKG

@lodestar/beacon-node

Version:

A Typescript implementation of the beacon chain

25 lines 1.21 kB
import { ResponseIncoming } from "@lodestar/reqresp"; import { SignedBeaconBlock, phase0 } from "@lodestar/types"; import { LodestarError } from "@lodestar/utils"; import { SerializedCache } from "../../../util/serializedCache.js"; /** * Asserts a response from BeaconBlocksByRange respects the request and is sequential * Note: MUST allow missing block for skipped slots. */ export declare function collectSequentialBlocksInRange(blockStream: AsyncIterable<ResponseIncoming>, { count, startSlot }: Pick<phase0.BeaconBlocksByRangeRequest, "count" | "startSlot">, serializedCache?: SerializedCache): Promise<SignedBeaconBlock[]>; export declare enum BlocksByRangeErrorCode { UNDER_START_SLOT = "BLOCKS_BY_RANGE_ERROR_UNDER_START_SLOT", OVER_MAX_SLOT = "BLOCKS_BY_RANGE_ERROR_OVER_MAX_SLOT", BAD_SEQUENCE = "BLOCKS_BY_RANGE_ERROR_BAD_SEQUENCE" } type BlocksByRangeErrorType = { code: BlocksByRangeErrorCode.UNDER_START_SLOT; } | { code: BlocksByRangeErrorCode.OVER_MAX_SLOT; } | { code: BlocksByRangeErrorCode.BAD_SEQUENCE; }; export declare class BlocksByRangeError extends LodestarError<BlocksByRangeErrorType> { } export {}; //# sourceMappingURL=collectSequentialBlocksInRange.d.ts.map