fix: pass client to prover after creating client in factory. don't try to parse thr messages
This commit is contained in:
parent
816bd93e80
commit
481757e019
|
@ -5,18 +5,22 @@ import * as capella from "@lodestar/types/capella";
|
|||
import { consensusClient } from "#util.js";
|
||||
|
||||
function createDefaultClient(beaconUrl: string): Client {
|
||||
return new Client({
|
||||
const options = {
|
||||
store: new Store(),
|
||||
prover: new Prover(async (args) => {
|
||||
const res = await consensusClient.get(
|
||||
return (
|
||||
await consensusClient.get(
|
||||
`/eth/v1/beacon/light_client/updates?start_period=${args.start}&count=${args.count}`,
|
||||
);
|
||||
return res.data.map((u: any) =>
|
||||
capella.ssz.LightClientUpdate.fromJson(u.data),
|
||||
);
|
||||
)
|
||||
).data;
|
||||
}),
|
||||
beaconUrl,
|
||||
});
|
||||
};
|
||||
|
||||
const client = new Client(options);
|
||||
options.prover.client = client;
|
||||
|
||||
return client;
|
||||
}
|
||||
|
||||
export { Client, Prover, Store, createDefaultClient };
|
||||
|
|
Loading…
Reference in New Issue