fix: add optimisticUpdateCallback to options
This commit is contained in:
parent
4be6c339c7
commit
464fb21095
|
@ -2,7 +2,7 @@ import Client from "./client.js";
|
||||||
import Store from "../store.js";
|
import Store from "../store.js";
|
||||||
import Prover from "#prover.js";
|
import Prover from "#prover.js";
|
||||||
import * as capella from "@lodestar/types/capella";
|
import * as capella from "@lodestar/types/capella";
|
||||||
import { consensusClient } from "#util.js";
|
import { consensusClient, getConsensusOptimisticUpdate } from "#util.js";
|
||||||
|
|
||||||
function createDefaultClient(beaconUrl: string): Client {
|
function createDefaultClient(beaconUrl: string): Client {
|
||||||
const options = {
|
const options = {
|
||||||
|
@ -15,6 +15,11 @@ function createDefaultClient(beaconUrl: string): Client {
|
||||||
).data;
|
).data;
|
||||||
}),
|
}),
|
||||||
beaconUrl,
|
beaconUrl,
|
||||||
|
async optimisticUpdateCallback() {
|
||||||
|
const update = await getConsensusOptimisticUpdate();
|
||||||
|
|
||||||
|
return capella.ssz.LightClientOptimisticUpdate.fromJson(update);
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
const client = new Client(options);
|
const client = new Client(options);
|
||||||
|
|
Loading…
Reference in New Issue