-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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.
- Loading branch information
Showing
3 changed files
with
8 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters