refactor: make optimisticUpdateCallback a dedicated type
This commit is contained in:
parent
4b9aca2086
commit
977d33b768
|
@ -2,8 +2,8 @@ import { ClientConfig, ExecutionInfo, IProver, IStore } from "#interfaces.js";
|
||||||
import { POLLING_DELAY } from "#constants.js";
|
import { POLLING_DELAY } from "#constants.js";
|
||||||
import {
|
import {
|
||||||
computeSyncPeriodAtSlot,
|
computeSyncPeriodAtSlot,
|
||||||
getCurrentSlot,
|
|
||||||
deserializeSyncCommittee,
|
deserializeSyncCommittee,
|
||||||
|
getCurrentSlot,
|
||||||
} from "@lodestar/light-client/utils";
|
} from "@lodestar/light-client/utils";
|
||||||
import bls, { init } from "@chainsafe/bls/switchable";
|
import bls, { init } from "@chainsafe/bls/switchable";
|
||||||
import { Mutex } from "async-mutex";
|
import { Mutex } from "async-mutex";
|
||||||
|
@ -13,13 +13,13 @@ import {
|
||||||
getDefaultClientConfig,
|
getDefaultClientConfig,
|
||||||
optimisticUpdateVerify,
|
optimisticUpdateVerify,
|
||||||
} from "#util.js";
|
} from "#util.js";
|
||||||
import { capella, LightClientUpdate, OptimisticUpdate } from "#types.js";
|
import { LightClientUpdate, OptimisticUpdateCallback } from "#types.js";
|
||||||
import { assertValidLightClientUpdate } from "@lodestar/light-client/validation";
|
import { assertValidLightClientUpdate } from "@lodestar/light-client/validation";
|
||||||
|
|
||||||
export interface BaseClientOptions {
|
export interface BaseClientOptions {
|
||||||
prover: IProver;
|
prover: IProver;
|
||||||
store: IStore;
|
store: IStore;
|
||||||
optimisticUpdateCallback: () => Promise<OptimisticUpdate>;
|
optimisticUpdateCallback: OptimisticUpdateCallback;
|
||||||
}
|
}
|
||||||
|
|
||||||
export default abstract class BaseClient {
|
export default abstract class BaseClient {
|
||||||
|
|
|
@ -18,3 +18,5 @@ export type VerifyWithReason =
|
||||||
| { correct: false; reason: string };
|
| { correct: false; reason: string };
|
||||||
|
|
||||||
export { capella, phase0 };
|
export { capella, phase0 };
|
||||||
|
|
||||||
|
export type OptimisticUpdateCallback = () => Promise<OptimisticUpdate>;
|
||||||
|
|
Loading…
Reference in New Issue