fix: add optimisticUpdateCallback to options

This commit is contained in:
Derrick Hammer 2023-07-13 02:33:07 -04:00
parent 4be6c339c7
commit 464fb21095
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 6 additions and 1 deletions

View File

@ -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);