From 36abc77898df8d889c5962a7c1df7151b6465bf7 Mon Sep 17 00:00:00 2001 From: nicholaspai Date: Thu, 21 Sep 2023 10:14:12 -0400 Subject: [PATCH] fix --- test/HubPoolClient.Utilization.ts | 6 +++--- test/SpokePoolClient.SpeedUp.ts | 6 +++--- test/SpokePoolClient.ValidateFill.ts | 18 +++++++++--------- test/SpokePoolClient.deposits.ts | 6 +++--- 4 files changed, 18 insertions(+), 18 deletions(-) diff --git a/test/HubPoolClient.Utilization.ts b/test/HubPoolClient.Utilization.ts index a2f96f6b08..255c7d72ca 100644 --- a/test/HubPoolClient.Utilization.ts +++ b/test/HubPoolClient.Utilization.ts @@ -1,4 +1,4 @@ -import { HubPoolClient } from "../src/clients"; +import { clients } from "@across-protocol/sdk-v2"; import { amountToLp, destinationChainId, @@ -29,7 +29,7 @@ import { let configStore: Contract, hubPool: Contract; let l1Token: Contract, l2Token: Contract, timer: Contract, weth: Contract; -let configStoreClient: MockConfigStoreClient, hubPoolClient: HubPoolClient; +let configStoreClient: MockConfigStoreClient, hubPoolClient: clients.HubPoolClient; let owner: SignerWithAddress; // Same rate model used for across-v1 tests: @@ -96,7 +96,7 @@ describe("HubPool Utilization", async function () { await configStoreClient.update(); - hubPoolClient = new HubPoolClient(createSpyLogger().spyLogger, hubPool, configStoreClient); + hubPoolClient = new clients.HubPoolClient(createSpyLogger().spyLogger, hubPool, configStoreClient as unknown as clients.AcrossConfigStoreClient); await configStoreClient.update(); await hubPoolClient.update(); }); diff --git a/test/SpokePoolClient.SpeedUp.ts b/test/SpokePoolClient.SpeedUp.ts index c808aa4835..bd8e8f4e01 100644 --- a/test/SpokePoolClient.SpeedUp.ts +++ b/test/SpokePoolClient.SpeedUp.ts @@ -14,14 +14,14 @@ import { toBNWei, } from "./utils"; -import { SpokePoolClient } from "../src/clients"; +import { clients } from "@across-protocol/sdk-v2" import { DepositWithBlock } from "../src/interfaces"; let spokePool: Contract, erc20: Contract, destErc20: Contract, weth: Contract; let depositor: SignerWithAddress, deploymentBlock: number; const destinationChainId2 = destinationChainId + 1; -let spokePoolClient: SpokePoolClient; +let spokePoolClient: clients.SpokePoolClient; describe("SpokePoolClient: SpeedUp", async function () { const ignoredFields = [ @@ -37,7 +37,7 @@ describe("SpokePoolClient: SpeedUp", async function () { [, depositor] = await ethers.getSigners(); ({ spokePool, erc20, destErc20, weth, deploymentBlock } = await deploySpokePoolWithToken(originChainId)); await enableRoutes(spokePool, [{ originToken: erc20.address, destinationChainId: destinationChainId2 }]); - spokePoolClient = new SpokePoolClient(createSpyLogger().spyLogger, spokePool, null, originChainId, deploymentBlock); + spokePoolClient = new clients.SpokePoolClient(createSpyLogger().spyLogger, spokePool, null, originChainId, deploymentBlock); await setupTokensForWallet(spokePool, depositor, [erc20, destErc20], weth, 10); }); diff --git a/test/SpokePoolClient.ValidateFill.ts b/test/SpokePoolClient.ValidateFill.ts index a2b1a9ec59..d66e94ba2b 100644 --- a/test/SpokePoolClient.ValidateFill.ts +++ b/test/SpokePoolClient.ValidateFill.ts @@ -27,10 +27,10 @@ import { sinon, } from "./utils"; -import { ConfigStoreClient, HubPoolClient, SpokePoolClient } from "../src/clients"; +import { ConfigStoreClient } from "../src/clients"; import { queryHistoricalDepositForFill } from "../src/utils"; import { MockConfigStoreClient, MockSpokePoolClient } from "./mocks"; -import { utils } from "@across-protocol/sdk-v2"; +import { utils, clients } from "@across-protocol/sdk-v2"; import { CHAIN_ID_TEST_LIST, repaymentChainId } from "./constants"; const { validateFillForDeposit } = utils; @@ -40,8 +40,8 @@ let spokePool1DeploymentBlock: number, spokePool2DeploymentBlock: number; let l1Token: Contract, configStore: Contract; let spy: sinon.SinonSpy, spyLogger: winston.Logger; -let spokePoolClient2: SpokePoolClient, hubPoolClient: HubPoolClient; -let spokePoolClient1: SpokePoolClient, configStoreClient: ConfigStoreClient; +let spokePoolClient2: clients.SpokePoolClient, hubPoolClient: clients.HubPoolClient; +let spokePoolClient1: clients.SpokePoolClient, configStoreClient: ConfigStoreClient; describe("SpokePoolClient: Fill Validation", async function () { beforeEach(async function () { @@ -81,17 +81,17 @@ describe("SpokePoolClient: Fill Validation", async function () { ) as unknown as ConfigStoreClient; await configStoreClient.update(); - hubPoolClient = new HubPoolClient(spyLogger, hubPool, configStoreClient); + hubPoolClient = new clients.HubPoolClient(spyLogger, hubPool, configStoreClient as unknown as clients.AcrossConfigStoreClient); await hubPoolClient.update(); - spokePoolClient1 = new SpokePoolClient( + spokePoolClient1 = new clients.SpokePoolClient( spyLogger, spokePool_1, hubPoolClient, originChainId, spokePool1DeploymentBlock ); - spokePoolClient2 = new SpokePoolClient( + spokePoolClient2 = new clients.SpokePoolClient( createSpyLogger().spyLogger, spokePool_2, null, @@ -132,7 +132,7 @@ describe("SpokePoolClient: Fill Validation", async function () { it("Returns deposit matched with fill", async function () { const deposit_1 = await buildDeposit(hubPoolClient, spokePool_1, erc20_1, l1Token, depositor, destinationChainId); const fill_1 = await buildFill(spokePool_2, erc20_2, depositor, relayer, deposit_1, 0.5); - const spokePoolClientForDestinationChain = new SpokePoolClient( + const spokePoolClientForDestinationChain = new clients.SpokePoolClient( createSpyLogger().spyLogger, spokePool_1, null, @@ -488,7 +488,7 @@ describe("SpokePoolClient: Fill Validation", async function () { const fill_1 = await buildFill(spokePool_2, erc20_2, depositor, relayer, expectedDeposit, 0.2); const fill_2 = await buildModifiedFill(spokePool_2, depositor, relayer, fill_1, 2, 0.2, relayer.address, "0x12"); // Fill same % of deposit with 2x larger relayer fee pct. - const spokePoolClientForDestinationChain = new SpokePoolClient( + const spokePoolClientForDestinationChain = new clients.SpokePoolClient( createSpyLogger().spyLogger, spokePool_1, null, diff --git a/test/SpokePoolClient.deposits.ts b/test/SpokePoolClient.deposits.ts index ae493e27b4..76203eb36e 100644 --- a/test/SpokePoolClient.deposits.ts +++ b/test/SpokePoolClient.deposits.ts @@ -1,4 +1,4 @@ -import { SpokePoolClient } from "../src/clients"; +import { clients } from "@across-protocol/sdk-v2" import { Contract, SignerWithAddress, @@ -18,14 +18,14 @@ let depositor1: SignerWithAddress, depositor2: SignerWithAddress; let deploymentBlock: number; const destinationChainId2 = destinationChainId + 1; -let spokePoolClient: SpokePoolClient; +let spokePoolClient: clients.SpokePoolClient; describe("SpokePoolClient: Deposits", async function () { beforeEach(async function () { [, depositor1, depositor2] = await ethers.getSigners(); ({ spokePool, erc20, destErc20, weth, deploymentBlock } = await deploySpokePoolWithToken(originChainId)); await enableRoutes(spokePool, [{ originToken: erc20.address, destinationChainId: destinationChainId2 }]); - spokePoolClient = new SpokePoolClient(createSpyLogger().spyLogger, spokePool, null, originChainId, deploymentBlock); + spokePoolClient = new clients.SpokePoolClient(createSpyLogger().spyLogger, spokePool, null, originChainId, deploymentBlock); await setupTokensForWallet(spokePool, depositor1, [erc20, destErc20], weth, 10); await setupTokensForWallet(spokePool, depositor2, [erc20, destErc20], weth, 10);