From 977d33b768b03a336e03aa0f9004aa0833f51ae2 Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Thu, 13 Jul 2023 02:53:00 -0400 Subject: [PATCH] refactor: make optimisticUpdateCallback a dedicated type --- src/baseClient.ts | 6 +++--- src/types.ts | 2 ++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/baseClient.ts b/src/baseClient.ts index 4ef9996..9da65fb 100644 --- a/src/baseClient.ts +++ b/src/baseClient.ts @@ -2,8 +2,8 @@ import { ClientConfig, ExecutionInfo, IProver, IStore } from "#interfaces.js"; import { POLLING_DELAY } from "#constants.js"; import { computeSyncPeriodAtSlot, - getCurrentSlot, deserializeSyncCommittee, + getCurrentSlot, } from "@lodestar/light-client/utils"; import bls, { init } from "@chainsafe/bls/switchable"; import { Mutex } from "async-mutex"; @@ -13,13 +13,13 @@ import { getDefaultClientConfig, optimisticUpdateVerify, } from "#util.js"; -import { capella, LightClientUpdate, OptimisticUpdate } from "#types.js"; +import { LightClientUpdate, OptimisticUpdateCallback } from "#types.js"; import { assertValidLightClientUpdate } from "@lodestar/light-client/validation"; export interface BaseClientOptions { prover: IProver; store: IStore; - optimisticUpdateCallback: () => Promise; + optimisticUpdateCallback: OptimisticUpdateCallback; } export default abstract class BaseClient { diff --git a/src/types.ts b/src/types.ts index 6633858..7fd7b20 100644 --- a/src/types.ts +++ b/src/types.ts @@ -18,3 +18,5 @@ export type VerifyWithReason = | { correct: false; reason: string }; export { capella, phase0 }; + +export type OptimisticUpdateCallback = () => Promise;