From 142d7aea49108b21f37cc5ed6f3c916cded681b5 Mon Sep 17 00:00:00 2001 From: Paul <108695806+pxrl@users.noreply.github.com> Date: Fri, 23 Feb 2024 10:16:41 +1100 Subject: [PATCH] improve(SpokePoolClient): Fix re-export (#1223) Extending and exporting a the SpokePoolClient class frequently causes tsc warnings to be flagged when running with a locally linked sdk-v2. Now that it's physically impossible for an early v2 deposit event to occur, remove the override and revert to simply exporting directly. --- src/clients/SpokePoolClient.ts | 13 ++----------- src/clients/bridges/ZKSyncAdapter.ts | 2 +- src/clients/index.ts | 6 +++++- 3 files changed, 8 insertions(+), 13 deletions(-) diff --git a/src/clients/SpokePoolClient.ts b/src/clients/SpokePoolClient.ts index ea662d36d..0d1f0ebb9 100644 --- a/src/clients/SpokePoolClient.ts +++ b/src/clients/SpokePoolClient.ts @@ -1,13 +1,4 @@ import { clients } from "@across-protocol/sdk-v2"; -import { FundsDepositedEvent } from "../interfaces"; -import { isDefined } from "../utils/TypeGuards"; -export class SpokePoolClient extends clients.SpokePoolClient { - _isEarlyDeposit(depositEvent: FundsDepositedEvent, currentTime: number): boolean { - const hubCurrentTime = this.hubPoolClient?.currentTime; - if (!isDefined(hubCurrentTime)) { - throw new Error("HubPoolClient's currentTime is not defined"); - } - return depositEvent.args.quoteTimestamp > currentTime || depositEvent.args.quoteTimestamp > hubCurrentTime; - } -} +export type SpokePoolClient = clients.SpokePoolClient; +export const { SpokePoolClient } = clients; diff --git a/src/clients/bridges/ZKSyncAdapter.ts b/src/clients/bridges/ZKSyncAdapter.ts index eb1ba5e29..20fff88b7 100644 --- a/src/clients/bridges/ZKSyncAdapter.ts +++ b/src/clients/bridges/ZKSyncAdapter.ts @@ -12,7 +12,7 @@ import { getTokenAddress, TOKEN_SYMBOLS_MAP, } from "../../utils"; -import { SpokePoolClient } from "../SpokePoolClient"; +import { SpokePoolClient } from "../."; import assert from "assert"; import * as zksync from "zksync-web3"; import { CONTRACT_ADDRESSES } from "../../common"; diff --git a/src/clients/index.ts b/src/clients/index.ts index c476c47e8..897540dd0 100644 --- a/src/clients/index.ts +++ b/src/clients/index.ts @@ -1,7 +1,11 @@ +import { clients } from "@across-protocol/sdk-v2"; + +export type SpokePoolClient = clients.SpokePoolClient; +export const { SpokePoolClient } = clients; + export * from "./BalanceAllocator"; export * from "./BundleDataClient"; export * from "./HubPoolClient"; -export * from "./SpokePoolClient"; export * from "./ConfigStoreClient"; export * from "./MultiCallerClient"; export * from "./ProfitClient";