import { computeEpochAtSlot } from "@lodestar/state-transition";
import { toRootHex } from "@lodestar/utils";
export async function* onBeaconBlocksByRoot(requestBody, chain) {
    for (const blockRoot of requestBody) {
        const root = blockRoot;
        const block = await chain.getSerializedBlockByRoot(toRootHex(root));
        if (block) {
            yield {
                data: block.block,
                boundary: chain.config.getForkBoundaryAtEpoch(computeEpochAtSlot(block.slot)),
            };
        }
    }
}
//# sourceMappingURL=beaconBlocksByRoot.js.map