From 464fb2109514b147b25d1d760eb4a7677ac8fea3 Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Thu, 13 Jul 2023 02:33:07 -0400 Subject: [PATCH] fix: add optimisticUpdateCallback to options --- src/node/index.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/node/index.ts b/src/node/index.ts index 0bd14e7..9acf96f 100644 --- a/src/node/index.ts +++ b/src/node/index.ts @@ -2,7 +2,7 @@ import Client from "./client.js"; import Store from "../store.js"; import Prover from "#prover.js"; import * as capella from "@lodestar/types/capella"; -import { consensusClient } from "#util.js"; +import { consensusClient, getConsensusOptimisticUpdate } from "#util.js"; function createDefaultClient(beaconUrl: string): Client { const options = { @@ -15,6 +15,11 @@ function createDefaultClient(beaconUrl: string): Client { ).data; }), beaconUrl, + async optimisticUpdateCallback() { + const update = await getConsensusOptimisticUpdate(); + + return capella.ssz.LightClientOptimisticUpdate.fromJson(update); + }, }; const client = new Client(options);