From b97ef5c06fcbf9180141ffed9df7cb5d6fd6c136 Mon Sep 17 00:00:00 2001 From: bhavik Date: Tue, 30 Nov 2021 00:22:32 +0530 Subject: [PATCH] updated test --- test/mainnet/aave/v1.test.ts | 26 +++++++-------- test/mainnet/aave/v2.test.ts | 24 +++++++------- test/mainnet/b.protocol/b.compound.test.ts | 16 +++++----- test/mainnet/b.protocol/b.liquity.test.ts | 28 ++++++++-------- test/mainnet/b.protocol/b.maker.test.ts | 32 +++++++++---------- .../mainnet/basic-ERC1155/ERC1155-transfer.ts | 24 +++++++------- test/mainnet/basic-ERC721/ERC721-transfer.ts | 27 +++++++++------- test/mainnet/compound/compound.test.ts | 16 +++++----- test/mainnet/instapool/instapool.test.ts | 18 +++++------ test/mainnet/liquity/liquity.helpers.ts | 24 +++++++------- test/mainnet/liquity/liquity.test.ts | 4 +-- test/mainnet/mappings/mappings.test.ts | 6 ++-- .../pooltogether-polygon/pooltogether.test.ts | 9 +++--- .../mainnet/pooltogether/pooltogether.test.ts | 20 ++++++------ test/mainnet/uniswap/uniswap.test.ts | 12 +++---- .../mainnet/uniswapStake/uniswapStake.test.ts | 30 +++++++++-------- test/mainnet/yearn/yearn.test.ts | 9 +++--- 17 files changed, 166 insertions(+), 159 deletions(-) diff --git a/test/mainnet/aave/v1.test.ts b/test/mainnet/aave/v1.test.ts index a30d58ed..70c94f9b 100644 --- a/test/mainnet/aave/v1.test.ts +++ b/test/mainnet/aave/v1.test.ts @@ -2,27 +2,27 @@ import { expect } from "chai"; import hre from "hardhat"; import { abis } from "../../../scripts/constant/abis"; import { addresses } from "../../../scripts/constant/addresses"; -import deployAndEnableConnector from "../../../scripts/deployAndEnableConnector"; -import getMasterSigner from "../../../scripts/getMasterSigner"; -import buildDSAv2 from "../../../scripts/buildDSAv2"; +import { deployAndEnableConnector } from "../../../scripts/deployAndEnableConnector"; +import { getMasterSigner } from "../../../scripts/getMasterSigner"; +import { buildDSAv2 } from "../../../scripts/buildDSAv2"; import ConnectV2AaveV1 from "../../artifacts/contracts/mainnet/connectors/aave/v1/main.sol/ConnectV2AaveV1.json"; import { parseEther } from "@ethersproject/units"; -import encodeSpells from "../../../scripts/encodeSpells"; -import tokens from "../../../scripts/constant/tokens"; -import constants from "../../../scripts/constant/constant"; -import addLiquidity from "../../../scripts/addLiquidity"; -const { ethers } = hre; +import { encodeSpells } from "../../../scripts/encodeSpells"; +import { tokens } from "../../../scripts/constant/tokens"; +import { constants } from "../../../scripts/constant/constant"; +import { addLiquidity } from "../../../scripts/addLiquidity"; +// const { ethers } = hre; const ALCHEMY_ID = process.env.ALCHEMY_ID; describe("Aave V1", function () { const connectorName = "AAVEV1-TEST-A"; - let wallet0, wallet1; - let dsaWallet0; - let instaConnectorsV2; - let connector; - let masterSigner; + let wallet0: any, wallet1: any; + let dsaWallet0: any; + let instaConnectorsV2: any; + let connector: any; + let masterSigner: any; before(async () => { try { diff --git a/test/mainnet/aave/v2.test.ts b/test/mainnet/aave/v2.test.ts index 7ace521a..b836b088 100644 --- a/test/mainnet/aave/v2.test.ts +++ b/test/mainnet/aave/v2.test.ts @@ -2,25 +2,25 @@ import { expect } from "chai"; import hre from "hardhat"; import { abis } from "../../../scripts/constant/abis"; import { addresses } from "../../../scripts/constant/addresses"; -import deployAndEnableConnector from "../../../scripts/deployAndEnableConnector"; -import getMasterSigner from "../../../scripts/getMasterSigner"; -import buildDSAv2 from "../../../scripts/buildDSAv2"; -import ConnectV2AaveV2 from "../../artifacts/contracts/mainnet/connectors/aave/v2/main.sol/ConnectV2AaveV2.json"; +import { deployAndEnableConnector } from "../../../scripts/deployAndEnableConnector"; +import { getMasterSigner } from "../../../scripts/getMasterSigner"; +import { buildDSAv2 } from "../../../scripts/buildDSAv2"; +import { ConnectV2AaveV2 } from "../../artifacts/contracts/mainnet/connectors/aave/v2/main.sol/ConnectV2AaveV2.json"; import { parseEther } from "@ethersproject/units"; -import encodeSpells from "../../../scripts/encodeSpells"; +import { encodeSpells } from "../../../scripts/encodeSpells"; import { tokens } from "../../../scripts/constant/tokens"; import { constants } from "../../../scripts/constant/constant"; -import addLiquidity from "../../../scripts/addLiquidity"; -const { ethers } = hre; +import { addLiquidity } from "../../../scripts/addLiquidity"; +// const { ethers } = hre; describe("Aave V2", function () { const connectorName = "AAVEV2-TEST-A"; - let wallet0, wallet1; - let dsaWallet0; - let instaConnectorsV2; - let connector; - let masterSigner; + let wallet0: any, wallet1: any; + let dsaWallet0: any; + let instaConnectorsV2: any; + let connector: any; + let masterSigner: any; before(async () => { await hre.network.provider.request({ diff --git a/test/mainnet/b.protocol/b.compound.test.ts b/test/mainnet/b.protocol/b.compound.test.ts index 16af19ff..a8bfffe7 100644 --- a/test/mainnet/b.protocol/b.compound.test.ts +++ b/test/mainnet/b.protocol/b.compound.test.ts @@ -3,10 +3,10 @@ import hre from "hardhat"; const { web3, deployments, waffle, ethers } = hre; //check const { provider, deployContract } = waffle -import deployAndEnableConnector from "../../../scripts/deployAndEnableConnector.js" -import buildDSAv2 from "../../../scripts/buildDSAv2" -import encodeSpells from "../../../scripts/encodeSpells.js" -import getMasterSigner from "../../../scripts/getMasterSigner" +import { deployAndEnableConnector } from "../../../scripts/deployAndEnableConnector.js" +import { buildDSAv2 } from "../../../scripts/buildDSAv2" +import { encodeSpells } from "../../../scripts/encodeSpells.js" +import { getMasterSigner } from "../../../scripts/getMasterSigner" import { addresses } from "../../../scripts/constant/addresses"; import { abis } from "../../../scripts/constant/abis"; @@ -18,10 +18,10 @@ import connectV2CompoundArtifacts from "../../artifacts/contracts/mainnet/connec describe("B.Compound", function () { const connectorName = "B.COMPOUND-TEST-A" - let dsaWallet0 - let masterSigner; - let instaConnectorsV2; - let connector; + let dsaWallet0: any; + let masterSigner: any; + let instaConnectorsV2: any; + let connector: any; const wallets = provider.getWallets() const [wallet0, wallet1, wallet2, wallet3] = wallets diff --git a/test/mainnet/b.protocol/b.liquity.test.ts b/test/mainnet/b.protocol/b.liquity.test.ts index 783c9df2..a59299a0 100644 --- a/test/mainnet/b.protocol/b.liquity.test.ts +++ b/test/mainnet/b.protocol/b.liquity.test.ts @@ -3,10 +3,10 @@ import hre from "hardhat"; const { web3, deployments, waffle, ethers } = hre; //check const { provider, deployContract } = waffle -import deployAndEnableConnector from "../../../scripts/deployAndEnableConnector.js" -import buildDSAv2 from "../../../scripts/buildDSAv2" -import encodeSpells from "../../../scripts/encodeSpells.js" -import getMasterSigner from "../../../scripts/getMasterSigner" +import { deployAndEnableConnector } from "../../../scripts/deployAndEnableConnector.js" +import { buildDSAv2 } from "../../../scripts/buildDSAv2" +import { encodeSpells } from "../../../scripts/encodeSpells.js" +import { getMasterSigner } from "../../../scripts/getMasterSigner" import { addresses } from "../../../scripts/constant/addresses"; import { abis } from "../../../scripts/constant/abis"; import { constants } from "../../../scripts/constant/constant"; @@ -21,16 +21,16 @@ const BAMM_ADDRESS = "0x0d3AbAA7E088C2c82f54B2f47613DA438ea8C598" describe("B.Liquity", function () { const connectorName = "B.LIQUITY-TEST-A" - let dsaWallet0; - let dsaWallet1; - let masterSigner; - let instaConnectorsV2; - let connector; - let manager; - let vat; - let lusd; - let bammToken; - let stabilityPool; + let dsaWallet0: any; + let dsaWallet1: any + let masterSigner: any; + let instaConnectorsV2: any; + let connector: any; + let manager: any; + let vat: any; + let lusd: any; + let bammToken: any; + let stabilityPool: any; const wallets = provider.getWallets() const [wallet0, wallet1, wallet2, wallet3] = wallets diff --git a/test/mainnet/b.protocol/b.maker.test.ts b/test/mainnet/b.protocol/b.maker.test.ts index 1819b720..a04a0f20 100644 --- a/test/mainnet/b.protocol/b.maker.test.ts +++ b/test/mainnet/b.protocol/b.maker.test.ts @@ -3,29 +3,29 @@ import hre from "hardhat"; const { web3, deployments, waffle, ethers } = hre; const { provider, deployContract } = waffle -import deployAndEnableConnector from "../../../scripts/deployAndEnableConnector.js" -import buildDSAv2 from "../../../scripts/buildDSAv2" -import encodeSpells from "../../../scripts/encodeSpells.js" -import getMasterSigner from "../../../scripts/getMasterSigner" -import addresses from "../../../scripts/constant/addresses" -import abis from "../../../scripts/constant/abis" -import constants from "../../../scripts/constant/constant" -import tokens from "../../../scripts/constant/tokens" +import { deployAndEnableConnector } from "../../../scripts/deployAndEnableConnector.js" +import { buildDSAv2 } from "../../../scripts/buildDSAv2" +import { encodeSpells } from "../../../scripts/encodeSpells.js" +import { getMasterSigner } from "../../../scripts/getMasterSigner" +import { addresses } from "../../../scripts/constant/addresses"; +import { abis } from "../../../scripts/constant/abis"; +import { constants } from "../../../scripts/constant/constant"; +import { tokens } from "../../../scripts/constant/tokens"; import connectorMakerArtifacts from ("../../artifacts/contracts/mainnet/connectors/b.protocol/makerdao/main.sol/ConnectV2BMakerDAO.json") describe("B.Maker", function () { const connectorName = "B.MAKER-TEST-A" - let dsaWallet0; - let dsaWallet1; - let masterSigner; - let instaConnectorsV2; - let connector; - let manager; - let vat; - let dai; + let dsaWallet0: any; + let dsaWallet1: any; + let masterSigner: any; + let instaConnectorsV2: any; + let connector: any; + let manager: any; + let vat: any; + let dai: any; const wallets = provider.getWallets() const [wallet0, wallet1, wallet2, wallet3] = wallets diff --git a/test/mainnet/basic-ERC1155/ERC1155-transfer.ts b/test/mainnet/basic-ERC1155/ERC1155-transfer.ts index 83b15a37..66130bac 100644 --- a/test/mainnet/basic-ERC1155/ERC1155-transfer.ts +++ b/test/mainnet/basic-ERC1155/ERC1155-transfer.ts @@ -4,10 +4,10 @@ const { web3, deployments, waffle, ethers } = hre; const { provider, deployContract } = waffle import { abi: implementationsABI } from "../../../scripts/constant/abi/core/InstaImplementations.json" -import deployAndEnableConnector from "../../../scripts/deployAndEnableConnector.js" -import buildDSAv2 from "../../../scripts/buildDSAv2" -import encodeSpells from "../../../scripts/encodeSpells.js" -import getMasterSigner from "../../../scripts/getMasterSigner" +import { deployAndEnableConnector } from "../../../scripts/deployAndEnableConnector.js" +import { buildDSAv2 } from "../../../scripts/buildDSAv2" +import { encodeSpells } from "../../../scripts/encodeSpells.js" +import { getMasterSigner } from "../../../scripts/getMasterSigner" import { addresses } from "../../../scripts/constant/addresses" import { abis } from "../../../scripts/constant/abis" @@ -26,13 +26,15 @@ const implementationsMappingAddr = "0xCBA828153d3a85b30B5b912e1f2daCac5816aE9D" describe("BASIC-ERC1155", function () { const connectorName = "BASIC-ERC1155-A" - let dsaWallet0 - let masterSigner; - let instaConnectorsV2; - let connector; - let nftContract; - let tokenOwner; - let instaImplementationsMapping; + let dsaWallet0: any; + let masterSigner: any; + let instaConnectorsV2: any; + let connector: any; + let nftContract: any; + let tokenOwner: any; + let instaImplementationsMapping: any; + let InstaAccountV2DefaultImpl: any; + let instaAccountV2DefaultImpl: any; const wallets = provider.getWallets() diff --git a/test/mainnet/basic-ERC721/ERC721-transfer.ts b/test/mainnet/basic-ERC721/ERC721-transfer.ts index 9b43941a..63b96004 100644 --- a/test/mainnet/basic-ERC721/ERC721-transfer.ts +++ b/test/mainnet/basic-ERC721/ERC721-transfer.ts @@ -4,10 +4,12 @@ const { web3, deployments, waffle, ethers } = hre; const { provider, deployContract } = waffle import { abi : implementationsABI } from "../../../scripts/constant/abi/core/InstaImplementations.json" -import deployAndEnableConnector from "../../../scripts/deployAndEnableConnector.js" -import buildDSAv2 from "../../../scripts/buildDSAv2" -import encodeSpells from "../../../scripts/encodeSpells.js" -import getMasterSigner from "../../../scripts/getMasterSigner" + +import { deployAndEnableConnector } from "../../../scripts/deployAndEnableConnector.js" +import { buildDSAv2 } from "../../../scripts/buildDSAv2" +import { encodeSpells } from "../../../scripts/encodeSpells.js" +import { getMasterSigner } from "../../../scripts/getMasterSigner" + import { addresses } from "../../../scripts/constant/addresses" import { abis } from "../../../scripts/constant/abis" @@ -26,14 +28,15 @@ const implementationsMappingAddr = "0xCBA828153d3a85b30B5b912e1f2daCac5816aE9D" describe("BASIC-ERC721", function () { const connectorName = "BASIC-ERC721-A" - let dsaWallet0 - let masterSigner; - let instaConnectorsV2; - let connector; - let nftContract; - let tokenOwner; - let instaImplementationsMapping; - + let dsaWallet0: any; + let masterSigner: any; + let instaConnectorsV2: any; + let connector: any; + let nftContract: any; + let tokenOwner: any; + let instaImplementationsMapping: any; + let InstaAccountV2DefaultImpl: any; + let instaAccountV2DefaultImpl: any; const wallets = provider.getWallets() const [wallet0, wallet1, wallet2, wallet3] = wallets diff --git a/test/mainnet/compound/compound.test.ts b/test/mainnet/compound/compound.test.ts index fcd538be..bf43420c 100644 --- a/test/mainnet/compound/compound.test.ts +++ b/test/mainnet/compound/compound.test.ts @@ -3,10 +3,10 @@ import hre from "hardhat"; import { web3, deployments, waffle, ethers } = hre; import { provider, deployContract } = waffle -import deployAndEnableConnector from "../../../scripts/deployAndEnableConnector.js" -import buildDSAv2 from "../../../scripts/buildDSAv2" -import encodeSpells from "../../../scripts/encodeSpells.js" -import getMasterSigner from "../../../scripts/getMasterSigner" +import { deployAndEnableConnector } from "../../../scripts/deployAndEnableConnector.js" +import { buildDSAv2 } from "../../../scripts/buildDSAv2" +import { encodeSpells } from "../../../scripts/encodeSpells.js" +import { getMasterSigner } from "../../../scripts/getMasterSigner" import { addresses } from "../../../scripts/constant/addresses"; import { abis } from "../../../scripts/constant/abis"; @@ -18,10 +18,10 @@ import connectV2CompoundArtifacts from "../../artifacts/contracts/mainnet/connec describe("Compound", function () { const connectorName = "COMPOUND-TEST-A" - let dsaWallet0 - let masterSigner; - let instaConnectorsV2; - let connector; + let dsaWallet0: any; + let masterSigner: any; + let instaConnectorsV2: any; + let connector: any; const wallets = provider.getWallets() const [wallet0, wallet1, wallet2, wallet3] = wallets diff --git a/test/mainnet/instapool/instapool.test.ts b/test/mainnet/instapool/instapool.test.ts index e98c960a..11365223 100644 --- a/test/mainnet/instapool/instapool.test.ts +++ b/test/mainnet/instapool/instapool.test.ts @@ -3,11 +3,11 @@ import hre from "hardhat"; const { web3, deployments, waffle, ethers } = hre; const { provider, deployContract } = waffle -import deployAndEnableConnector from "../../../scripts/deployAndEnableConnector.js" -import buildDSAv2 from "../../../scripts/buildDSAv2" -import encodeSpells from "../../../scripts/encodeSpells.js" -import encodeFlashcastData from "../../../scripts/encodeFlashcastData.js" -import getMasterSigner from "../../../scripts/getMasterSigner" +import { deployAndEnableConnector } from "../../../scripts/deployAndEnableConnector.js" +import { buildDSAv2 } from "../../../scripts/buildDSAv2" +import { encodeSpells } from "../../../scripts/encodeSpells.js" +import { encodeFlashcastData } from "../../../scripts/encodeFlashcastData.js" +import { getMasterSigner } from "../../../scripts/getMasterSigner" import { addresses } from "../../../scripts/constant/addresses"; import { abis } from "../../../scripts/constant/abis"; @@ -20,10 +20,10 @@ import connectV2CompoundArtifacts from "../../artifacts/contracts/mainnet/connec describe("Instapool", function () { const connectorName = "COMPOUND-TEST-A" - let dsaWallet0 - let masterSigner; - let instaConnectorsV2; - let connector; + let dsaWallet0: any; + let masterSigner: any; + let instaConnectorsV2: any; + let connector: any; const wallets = provider.getWallets() const [wallet0, wallet1, wallet2, wallet3] = wallets diff --git a/test/mainnet/liquity/liquity.helpers.ts b/test/mainnet/liquity/liquity.helpers.ts index 770da7d0..457a1412 100644 --- a/test/mainnet/liquity/liquity.helpers.ts +++ b/test/mainnet/liquity/liquity.helpers.ts @@ -2,14 +2,14 @@ import hre from "hardhat"; import hardhatConfig from "../../../hardhat.config"; // Instadapp deployment and testing helpers -import deployAndEnableConnector from "../../../scripts/deployAndEnableConnector.js"; -import encodeSpells from "../../../scripts/encodeSpells.js"; -import getMasterSigner from "../../../scripts/getMasterSigner"; -import buildDSAv2 from "../../../scripts/buildDSAv2"; +import { deployAndEnableConnector } from "../../../scripts/deployAndEnableConnector.js" +import { buildDSAv2 } from "../../../scripts/buildDSAv2" +import { encodeSpells } from "../../../scripts/encodeSpells.js" +import { getMasterSigner } from "../../../scripts/getMasterSigner" // Instadapp instadappAddresses/ABIs -import instadappAddresses from "../../../scripts/important/addresses"; -import instadappAbi from "../../../scripts/constant/abis"; +import { instadappAddresses } from "../../../scripts/important/addresses"; +import { instadappAbi } from "../../../scripts/constant/abis"; // Instadapp Liquity Connector artifacts import connectV2LiquityArtifacts from "../../artifacts/contracts/mainnet/connectors/liquity/main.sol/ConnectV2Liquity.json"; @@ -29,12 +29,12 @@ const INSTADAPP_BASIC_V1_CONNECTOR = "Basic-v1"; const openTroveSpell = async ( dsa, - signer, - depositAmount, - borrowAmount, - upperHint, - lowerHint, - maxFeePercentage + signer: any, + depositAmount: any, + borrowAmount: any, + upperHint: any, + lowerHint: any, + maxFeePercentage: any ) => { let address = signer.address; if (signer.address === undefined) { diff --git a/test/mainnet/liquity/liquity.test.ts b/test/mainnet/liquity/liquity.test.ts index 164b0fd7..70bf96db 100644 --- a/test/mainnet/liquity/liquity.test.ts +++ b/test/mainnet/liquity/liquity.test.ts @@ -2,8 +2,8 @@ import hre from "hardhat"; import { expect } from "chai"; // Instadapp deployment and testing helpers -import buildDSAv2 from "../../../scripts/buildDSAv2"; -import encodeSpells from "../../../scripts/encodeSpells.js"; +import { buildDSAv2 } from "../../../scripts/buildDSAv2"; +import { encodeSpells } from "../../../scripts/encodeSpells.js"; // Liquity smart contracts import contracts from "./liquity.contracts"; diff --git a/test/mainnet/mappings/mappings.test.ts b/test/mainnet/mappings/mappings.test.ts index 81829f6b..bea79b0d 100644 --- a/test/mainnet/mappings/mappings.test.ts +++ b/test/mainnet/mappings/mappings.test.ts @@ -13,9 +13,9 @@ const getMapping = (address, signer) => { }; describe("Test InstaMapping contract", () => { - let account, instaMaster; - let mappingAddress; - let masterMapping; + let account: any, instaMaster: any; + let mappingAddress: any; + let masterMapping: any; const indexInterfaceAddress = "0x2971AdFa57b20E5a416aE5a708A8655A9c74f723"; const testRoleAddress = "0x2971AdFa57b20E5a416aE5a708A8655A9c74f723"; diff --git a/test/mainnet/pooltogether-polygon/pooltogether.test.ts b/test/mainnet/pooltogether-polygon/pooltogether.test.ts index 907b382d..61eaa370 100644 --- a/test/mainnet/pooltogether-polygon/pooltogether.test.ts +++ b/test/mainnet/pooltogether-polygon/pooltogether.test.ts @@ -5,10 +5,11 @@ const { provider, deployContract } = waffle const ALCHEMY_ID = process.env.ALCHEMY_ID; -import deployAndEnableConnector from "../../../scripts/deployAndEnableConnector.js" -import buildDSAv2 from "../../../scripts/buildDSAv2" -import encodeSpells from "../../../scripts/encodeSpells.js" -import getMasterSigner from "../../../scripts/getMasterSigner" +import { deployAndEnableConnector } from "../../../scripts/deployAndEnableConnector.js" +import { buildDSAv2 } from "../../../scripts/buildDSAv2" +import { encodeSpells } from "../../../scripts/encodeSpells.js" +import { getMasterSigner } from "../../../scripts/getMasterSigner" + import { addresses } from "../../../scripts/constant/addresses" import { abis } from "../../../scripts/constant/abis" diff --git a/test/mainnet/pooltogether/pooltogether.test.ts b/test/mainnet/pooltogether/pooltogether.test.ts index a100b3d8..e980b2ba 100644 --- a/test/mainnet/pooltogether/pooltogether.test.ts +++ b/test/mainnet/pooltogether/pooltogether.test.ts @@ -3,10 +3,10 @@ import hre from "hardhat"; const { web3, deployments, waffle, ethers } = hre; const { provider, deployContract } = waffle -import deployAndEnableConnector from "../../../scripts/deployAndEnableConnector.js" -import buildDSAv2 from "../../../scripts/buildDSAv2" -import encodeSpells from "../../../scripts/encodeSpells.js" -import getMasterSigner from "../../../scripts/getMasterSigner" +import { deployAndEnableConnector } from "../../../scripts/deployAndEnableConnector.js" +import { buildDSAv2 } from "../../../scripts/buildDSAv2" +import { encodeSpells } from "../../../scripts/encodeSpells.js" +import { getMasterSigner } from "../../../scripts/getMasterSigner" import { addresses } from "../../../scripts/constant/addresses" import { abis } from "../../../scripts/constant/abis" @@ -64,12 +64,12 @@ describe("PoolTogether", function () { const uniswapConnectorName = "UNISWAP-TEST-A" const ptConnectorName = "POOLTOGETHER-TEST-A" - let dsaWallet0 - let masterSigner; - let instaConnectorsV2; - let connector; - let ptConnector; - let uniswapConnector; + let dsaWallet0: any + let masterSigner: any; + let instaConnectorsV2: any; + let connector: any; + let ptConnector: any; + let uniswapConnector: any; const wallets = provider.getWallets() const [wallet0, wallet1, wallet2, wallet3] = wallets diff --git a/test/mainnet/uniswap/uniswap.test.ts b/test/mainnet/uniswap/uniswap.test.ts index 4c4d9311..e9cb8acd 100644 --- a/test/mainnet/uniswap/uniswap.test.ts +++ b/test/mainnet/uniswap/uniswap.test.ts @@ -3,12 +3,12 @@ import hre from "hardhat"; const { web3, deployments, waffle, ethers } = hre; const { provider, deployContract } = waffle -import deployAndEnableConnector from "../../../scripts/deployAndEnableConnector.js"; -import buildDSAv2 from "../../../scripts/buildDSAv2"; -import encodeSpells from "../../../scripts/encodeSpells.js"; -import encodeFlashcastData from "../../../scripts/encodeFlashcastData.js"; -import getMasterSigner from "../../../scripts/getMasterSigner"; -import addLiquidity from "../../../scripts/addLiquidity"; +import { deployAndEnableConnector } from "../../../scripts/deployAndEnableConnector.js"; +import { buildDSAv2 } from "../../../scripts/buildDSAv2"; +import { encodeSpells } from "../../../scripts/encodeSpells.js"; +import { encodeFlashcastData } from "../../../scripts/encodeFlashcastData.js"; +import { getMasterSigner } from "../../../scripts/getMasterSigner"; +import { addLiquidity } from "../../../scripts/addLiquidity"; import { addresses } from "../../../scripts/constant/addresses"; import { abis } from "../../../scripts/constant/abis"; diff --git a/test/mainnet/uniswapStake/uniswapStake.test.ts b/test/mainnet/uniswapStake/uniswapStake.test.ts index c64f1614..54f26b57 100644 --- a/test/mainnet/uniswapStake/uniswapStake.test.ts +++ b/test/mainnet/uniswapStake/uniswapStake.test.ts @@ -3,14 +3,14 @@ import hre from "hardhat"; const { web3, deployments, waffle, ethers } = hre; const { provider, deployContract } = waffle -import deployAndEnableConnector from "../../../scripts/deployAndEnableConnector.js"; -import buildDSAv2 from "../../../scripts/buildDSAv2"; -import encodeSpells from "../../../scripts/encodeSpells.js"; -import getMasterSigner from "../../../scripts/getMasterSigner"; -import addLiquidity from "../../../scripts/addLiquidity"; +import { deployAndEnableConnector } from "../../../scripts/deployAndEnableConnector.js"; +import { buildDSAv2 } from "../../../scripts/buildDSAv2"; +import { encodeSpells } from "../../../scripts/encodeSpells.js"; +import { getMasterSigner } from "../../../scripts/getMasterSigner"; +import { addLiquidity } from "../../../scripts/addLiquidity"; -import addresses from "../../../scripts/constant/addresses"; -import abis from "../../../scripts/constant/abis"; +import { addresses } from "../../../scripts/constant/addresses"; +import { abis } from "../../../scripts/constant/abis"; import { abi: nftManagerAbi } from "@uniswap/v3-periphery/artifacts/contracts/NonfungiblePositionManager.sol/NonfungiblePositionManager.json" import connectV2UniswapStakerArtifacts from "../../artifacts/contracts/mainnet/connectors/uniswap/v3_staker/main.sol/ConnectV2UniswapV3Staker.json"; @@ -39,11 +39,11 @@ describe("UniswapV3", function () { const connectorStaker = "UniswapStaker-v1" const connectorUniswap = "UniswapV3-v1" - let dsaWallet0 - let masterSigner; - let instaConnectorsV2; - let connector; - let startTime, endTime; + let dsaWallet0: any + let masterSigner: any; + let instaConnectorsV2: any; + let connector: any; + let startTime: any, endTime: any; const wallets = provider.getWallets() const [wallet0, wallet1, wallet2, wallet3] = wallets @@ -61,7 +61,7 @@ describe("UniswapV3", function () { }); masterSigner = await getMasterSigner(wallet3) instaConnectorsV2 = await ethers.getContractAt(abis.core.connectorsV2, addresses.core.connectorsV2); - nftManager = await ethers.getContractAt(nftManagerAbi, "0xC36442b4a4522E871399CD717aBDD847Ab11FE88"); + let nftManager = await ethers.getContractAt(nftManagerAbi, "0xC36442b4a4522E871399CD717aBDD847Ab11FE88"); connector = await deployAndEnableConnector({ connectorName: connectorStaker, contractArtifact: connectV2UniswapStakerArtifacts, @@ -70,7 +70,7 @@ describe("UniswapV3", function () { }) console.log("Connector address", connector.address) - uniswapConnector = await deployAndEnableConnector({ + let uniswapConnector = await deployAndEnableConnector({ connectorName: connectorUniswap, contractArtifact: connectV2UniswapV3Artifacts, signer: masterSigner, @@ -287,6 +287,8 @@ describe("UniswapV3", function () { ethAddress, "1000", ], + }, + { connector: connectorStaker, method: "claimRewards", args: [ diff --git a/test/mainnet/yearn/yearn.test.ts b/test/mainnet/yearn/yearn.test.ts index 834e6cdc..ce762575 100644 --- a/test/mainnet/yearn/yearn.test.ts +++ b/test/mainnet/yearn/yearn.test.ts @@ -3,11 +3,10 @@ import hre from "hardhat"; const { web3, deployments, waffle, ethers } = hre; const { provider, deployContract } = waffle - -import deployAndEnableConnector from "../../../scripts/deployAndEnableConnector.js"; -import buildDSAv2 from "../../../scripts/buildDSAv2"; -import encodeSpells from "../../../scripts/encodeSpells.js"; -import getMasterSigner from "../../../scripts/getMasterSigner"; +import { deployAndEnableConnector } from "../../../scripts/deployAndEnableConnector.js" +import { buildDSAv2 } from "../../../scripts/buildDSAv2" +import { encodeSpells } from "../../../scripts/encodeSpells.js" +import { getMasterSigner } from "../../../scripts/getMasterSigner" import { addresses } from "../../../scripts/constant/addresses"; import { abis } from "../../../scripts/constant/abis";