Skip to content

Commit

Permalink
improve(SpokePoolClient): Fix re-export (#1223)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
pxrl authored Feb 22, 2024
1 parent 101f3dc commit 142d7ae
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 13 deletions.
13 changes: 2 additions & 11 deletions src/clients/SpokePoolClient.ts
Original file line number Diff line number Diff line change
@@ -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;
2 changes: 1 addition & 1 deletion src/clients/bridges/ZKSyncAdapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
6 changes: 5 additions & 1 deletion src/clients/index.ts
Original file line number Diff line number Diff line change
@@ -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";
Expand Down

0 comments on commit 142d7ae

Please sign in to comment.