From f0c5d05bb478d3eb1787432ff6e38950784b565b Mon Sep 17 00:00:00 2001 From: pcheremu Date: Tue, 26 Sep 2023 15:21:21 +0200 Subject: [PATCH] test: refactoring lint issues --- .gitignore | 3 ++- packages/bets/src/playbook/buffer/L1.txt | 2 +- packages/bets/src/playbook/buffer/L2.txt | 2 +- packages/bets/src/playbook/deploy/deploy-paymaster.ts | 1 - packages/bets/src/playbook/deploy/multicallCaller.ts | 1 - packages/bets/src/playbook/deploy/use-greeter.ts | 2 +- packages/bets/src/playbook/deploy/use-multitransferETH.ts | 2 +- packages/bets/src/playbook/deploy/use-paymaster.ts | 4 ++-- .../bets/src/playbook/scenarios/deploy/deployGreeterToL2.ts | 2 +- .../bets/src/playbook/scenarios/deploy/deployViaPaymaster.ts | 3 --- packages/bets/src/playbook/scenarios/deposit/depositERC20.ts | 2 +- .../src/playbook/scenarios/transfers/transferFailedState.ts | 4 ++-- .../src/playbook/scenarios/transfers/useMultitransferETH.ts | 2 -- packages/bets/tests/e2e/nft.spec.ts | 2 -- packages/bets/tests/sdk-api/nft.test.ts | 3 +-- packages/bets/tests/sdk-api/transactions/multiCall.test.ts | 2 +- .../bets/tests/sdk-api/transactions/multiTransfer.test.ts | 2 +- 17 files changed, 15 insertions(+), 24 deletions(-) diff --git a/.gitignore b/.gitignore index dd1123b504..ad3cd3469d 100644 --- a/.gitignore +++ b/.gitignore @@ -56,4 +56,5 @@ lerna-debug.log* packages/app/allure-results/ packages/app/tests/e2e/artifacts/ packages/bets/src/playbook/artifacts* -packages/bets/src/playbook/cache* \ No newline at end of file +packages/bets/src/playbook/cache* +packages/bets/src/playbook/buffer/* diff --git a/packages/bets/src/playbook/buffer/L1.txt b/packages/bets/src/playbook/buffer/L1.txt index 0acf6192c7..fc17721d48 100644 --- a/packages/bets/src/playbook/buffer/L1.txt +++ b/packages/bets/src/playbook/buffer/L1.txt @@ -1 +1 @@ -0x96b30fDfeEdffCafbb145401687D6b9B50EA1010 \ No newline at end of file +0x52546980e93668872651AFC9097db47e5DEc46f3 \ No newline at end of file diff --git a/packages/bets/src/playbook/buffer/L2.txt b/packages/bets/src/playbook/buffer/L2.txt index d5c962563e..2ea4dad7f0 100644 --- a/packages/bets/src/playbook/buffer/L2.txt +++ b/packages/bets/src/playbook/buffer/L2.txt @@ -1 +1 @@ -0xEBf9D3ead9A8c2bb8cEa438B8Dfa9f1AFf44bfa7 \ No newline at end of file +0xf43624d811c5DC9eF91cF237ab9B8eE220D438eE \ No newline at end of file diff --git a/packages/bets/src/playbook/deploy/deploy-paymaster.ts b/packages/bets/src/playbook/deploy/deploy-paymaster.ts index 4c4d336459..a8148f5b33 100644 --- a/packages/bets/src/playbook/deploy/deploy-paymaster.ts +++ b/packages/bets/src/playbook/deploy/deploy-paymaster.ts @@ -4,7 +4,6 @@ import { promises as fs } from "fs"; import { Wallet } from "zksync-web3"; import { Buffer, Wallets } from "../../entities"; -import { Playbook } from "../playbook"; import type { HardhatRuntimeEnvironment } from "hardhat/types"; diff --git a/packages/bets/src/playbook/deploy/multicallCaller.ts b/packages/bets/src/playbook/deploy/multicallCaller.ts index 8aa5ca3638..d609e8e28a 100644 --- a/packages/bets/src/playbook/deploy/multicallCaller.ts +++ b/packages/bets/src/playbook/deploy/multicallCaller.ts @@ -3,7 +3,6 @@ import { promises as fs } from "fs"; import { Buffer } from "../../entities"; import { Helper } from "../../helper"; -import displayVerificationInfo from "../utils/displayVerificationInfo"; import getWallet from "../utils/getWallet"; import type { HardhatRuntimeEnvironment } from "hardhat/types"; diff --git a/packages/bets/src/playbook/deploy/use-greeter.ts b/packages/bets/src/playbook/deploy/use-greeter.ts index 9eecc4be2d..d11a3b6610 100644 --- a/packages/bets/src/playbook/deploy/use-greeter.ts +++ b/packages/bets/src/playbook/deploy/use-greeter.ts @@ -12,7 +12,7 @@ import type { HardhatRuntimeEnvironment } from "hardhat/types"; export default async function (hre: HardhatRuntimeEnvironment) { const bufferRoute = "src/playbook/"; const helper = new Helper(); - let contract: any; + let contract: any; // eslint-disable-line const greeterContractAddress = await helper.getStringFromFile(bufferRoute + Buffer.greeterL2); diff --git a/packages/bets/src/playbook/deploy/use-multitransferETH.ts b/packages/bets/src/playbook/deploy/use-multitransferETH.ts index 01f2a69c40..5995db64d5 100644 --- a/packages/bets/src/playbook/deploy/use-multitransferETH.ts +++ b/packages/bets/src/playbook/deploy/use-multitransferETH.ts @@ -1,6 +1,6 @@ import * as ethers from "ethers"; import { promises as fs } from "fs"; -import { Provider, utils, Wallet } from "zksync-web3"; +import { Provider, Wallet } from "zksync-web3"; import { localConfig } from "../../config"; import { Buffer, Token, Wallets } from "../../entities"; diff --git a/packages/bets/src/playbook/deploy/use-paymaster.ts b/packages/bets/src/playbook/deploy/use-paymaster.ts index d5c5e7ad13..c98d397eaa 100644 --- a/packages/bets/src/playbook/deploy/use-paymaster.ts +++ b/packages/bets/src/playbook/deploy/use-paymaster.ts @@ -3,7 +3,7 @@ import { promises as fs } from "fs"; import { Provider, utils, Wallet } from "zksync-web3"; import { localConfig } from "../../config"; -import { Buffer, Wallets } from "../../entities"; +import { Buffer } from "../../entities"; import { Helper } from "../../helper"; import type { HardhatRuntimeEnvironment } from "hardhat/types"; @@ -49,7 +49,7 @@ export default async function (hre: HardhatRuntimeEnvironment) { }, }); - const fee = gasPrice.mul(gasLimit.toString()); + gasPrice.mul(gasLimit.toString()); const mintTx = await erc20.mint(emptyWallet.address, 90, { customData: { diff --git a/packages/bets/src/playbook/scenarios/deploy/deployGreeterToL2.ts b/packages/bets/src/playbook/scenarios/deploy/deployGreeterToL2.ts index 8c6ab4c51a..934b175849 100644 --- a/packages/bets/src/playbook/scenarios/deploy/deployGreeterToL2.ts +++ b/packages/bets/src/playbook/scenarios/deploy/deployGreeterToL2.ts @@ -1,4 +1,4 @@ -import { Buffer, Logger, Wallets } from "../../../entities"; +import { Buffer, Logger } from "../../../entities"; import { Helper } from "../../../helper"; let deployedContract: string; diff --git a/packages/bets/src/playbook/scenarios/deploy/deployViaPaymaster.ts b/packages/bets/src/playbook/scenarios/deploy/deployViaPaymaster.ts index 8beb475716..d047685687 100644 --- a/packages/bets/src/playbook/scenarios/deploy/deployViaPaymaster.ts +++ b/packages/bets/src/playbook/scenarios/deploy/deployViaPaymaster.ts @@ -1,20 +1,17 @@ import { Buffer } from "../../../entities"; import { Helper } from "../../../helper"; -import { Playbook } from "../../playbook"; export const deployViaPaymaster = async function () { const helper = new Helper(); const playbookRoot = "src/playbook/"; const bufferPaymaster = playbookRoot + Buffer.paymaster; const bufferCustomToken = playbookRoot + Buffer.paymaster; - const bufferEmptyWallet = playbookRoot + Buffer.emptyWalletAddress; await helper.executeScript(`cd ${playbookRoot} && npm run compile`); await helper.executeScript(`cd ${playbookRoot} && npm run deploy:paymaster`); const paymasterAddress = await helper.getStringFromFile(bufferPaymaster); const deployedToken = await helper.getStringFromFile(bufferCustomToken); - const emptyWallet = await helper.getStringFromFile(bufferEmptyWallet); console.log("The custom token has been deployed via Paymaster: ", deployedToken); console.log("The Paymaster transaction: ", paymasterAddress); diff --git a/packages/bets/src/playbook/scenarios/deposit/depositERC20.ts b/packages/bets/src/playbook/scenarios/deposit/depositERC20.ts index 8ba6605220..f18724a450 100644 --- a/packages/bets/src/playbook/scenarios/deposit/depositERC20.ts +++ b/packages/bets/src/playbook/scenarios/deposit/depositERC20.ts @@ -3,7 +3,7 @@ import { promises as fs } from "fs"; import * as zksync from "zksync-web3"; import { localConfig } from "../../../config"; -import { Buffer, Logger, Token, Wallets } from "../../../entities"; +import { Buffer, Logger, Wallets } from "../../../entities"; import { Helper } from "../../../helper"; const helper = new Helper(); diff --git a/packages/bets/src/playbook/scenarios/transfers/transferFailedState.ts b/packages/bets/src/playbook/scenarios/transfers/transferFailedState.ts index 9fc4dd1dc1..77bf391107 100644 --- a/packages/bets/src/playbook/scenarios/transfers/transferFailedState.ts +++ b/packages/bets/src/playbook/scenarios/transfers/transferFailedState.ts @@ -2,10 +2,10 @@ import * as ethers from "ethers"; import * as zksync from "zksync-web3"; import { localConfig } from "../../../config"; -import { Logger, Wallets } from "../../../entities"; +import { Logger } from "../../../entities"; import { Helper } from "../../../helper"; -export const transferFailedState = async function (tokenAddress: string, tokenName?: string, units = 18) { +export const transferFailedState = async function (tokenAddress: string, tokenName?: string) { const helper = new Helper(); const syncProvider = new zksync.Provider(localConfig.L2Network); const ethProvider = ethers.getDefaultProvider(localConfig.L1Network); diff --git a/packages/bets/src/playbook/scenarios/transfers/useMultitransferETH.ts b/packages/bets/src/playbook/scenarios/transfers/useMultitransferETH.ts index 802f4393a5..40ed959414 100644 --- a/packages/bets/src/playbook/scenarios/transfers/useMultitransferETH.ts +++ b/packages/bets/src/playbook/scenarios/transfers/useMultitransferETH.ts @@ -1,5 +1,3 @@ -import { HardhatRuntimeEnvironment } from "hardhat/types"; - import { Buffer } from "../../../entities"; import { Helper } from "../../../helper"; diff --git a/packages/bets/tests/e2e/nft.spec.ts b/packages/bets/tests/e2e/nft.spec.ts index 6e18b4cc6a..2e301ed232 100644 --- a/packages/bets/tests/e2e/nft.spec.ts +++ b/packages/bets/tests/e2e/nft.spec.ts @@ -12,7 +12,6 @@ let url: string; let bufferFile; let contract: string; let element: Locator; -let selector: string; //@id1658 test("Check the L2 NFT contract address", async ({ page }) => { @@ -25,7 +24,6 @@ test("Check the L2 NFT contract address", async ({ page }) => { await page.goto(targetUrl); element = await page.locator(`text=${contract}`).first(); - const richWallet = await page.locator(`text=0x36615...c049`).first(); await expect(element).toBeVisible(config.extraTimeout); }); diff --git a/packages/bets/tests/sdk-api/nft.test.ts b/packages/bets/tests/sdk-api/nft.test.ts index 1ca3d8f27a..e00eeab8fb 100644 --- a/packages/bets/tests/sdk-api/nft.test.ts +++ b/packages/bets/tests/sdk-api/nft.test.ts @@ -3,7 +3,7 @@ import { setTimeout } from "timers/promises"; import { environment } from "../../src/config"; import { localConfig } from "../../src/config"; -import { Logger, Token } from "../../src/entities"; +import { Logger } from "../../src/entities"; import { Playbook } from "../../src/playbook/playbook"; describe("NFTs", () => { @@ -13,7 +13,6 @@ describe("NFTs", () => { describe("Deploy/check the NFT", () => { jest.setTimeout(localConfig.standardTimeout); - let deployedToken: string; const playbook = new Playbook(); //@id672 diff --git a/packages/bets/tests/sdk-api/transactions/multiCall.test.ts b/packages/bets/tests/sdk-api/transactions/multiCall.test.ts index 375c14a61d..310a5fea9b 100644 --- a/packages/bets/tests/sdk-api/transactions/multiCall.test.ts +++ b/packages/bets/tests/sdk-api/transactions/multiCall.test.ts @@ -2,7 +2,7 @@ import * as request from "supertest"; import { setTimeout } from "timers/promises"; import { environment, localConfig } from "../../../src/config"; -import { Buffer, Logger, Token, TransactionsStatus, TransactionsType, Wallets } from "../../../src/entities"; +import { Buffer, Logger, Token, TransactionsType, Wallets } from "../../../src/entities"; import { Helper } from "../../../src/helper"; import { Playbook } from "../../../src/playbook/playbook"; diff --git a/packages/bets/tests/sdk-api/transactions/multiTransfer.test.ts b/packages/bets/tests/sdk-api/transactions/multiTransfer.test.ts index e92d2475f7..7bdde1c14f 100644 --- a/packages/bets/tests/sdk-api/transactions/multiTransfer.test.ts +++ b/packages/bets/tests/sdk-api/transactions/multiTransfer.test.ts @@ -2,7 +2,7 @@ import * as request from "supertest"; import { setTimeout } from "timers/promises"; import { environment, localConfig } from "../../../src/config"; -import { Buffer, Logger, Token, TransactionsStatus, TransactionsType, Wallets } from "../../../src/entities"; +import { Buffer, Logger, Token, TransactionsType, Wallets } from "../../../src/entities"; import { Helper } from "../../../src/helper"; import { Playbook } from "../../../src/playbook/playbook";