Skip to content

Commit

Permalink
test: update entities to constants name
Browse files Browse the repository at this point in the history
  • Loading branch information
pcheremu committed Mar 7, 2024
1 parent a433dc9 commit 1380443
Show file tree
Hide file tree
Showing 51 changed files with 52 additions and 52 deletions.
4 changes: 2 additions & 2 deletions packages/integration-tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ npm install
cp .env.example packages/integration-tests/src/playbook/.env
```

- Add your private wallet key to `WALLET_PRIVATE_KEY={YOUR_PRIVATE_KEY}`. By default we use `richWalletPrivateKey` private key in `integration-tests/src/playbook/utils/getWallet.ts` from `integration-tests/src/entities.ts`.
- Add your private wallet key to `WALLET_PRIVATE_KEY={YOUR_PRIVATE_KEY}`. By default we use `richWalletPrivateKey` private key in `integration-tests/src/playbook/utils/getWallet.ts` from `integration-tests/src/constants.ts`.

## Preparing a local environment

Expand Down Expand Up @@ -48,7 +48,7 @@ If you need to exclude some specific test/suite, you can change keywords `it` to
The test solution contains two main folders: [src](./src) and [tests](./tests).
[src](./src) folder contains:
- essential [scenarios](./src/playbook/scenarios/)
- predefined [entities](./src/entities.ts) and [config](./src/config.ts) config files
- predefined [constants](./src/constants.ts) and [config](./src/config.ts) config files
- [contracts](./src/playbook/contracts/) folder with a set of contracts
- [deploy](./src/playbook/deploy/) folder with a set of deploy scripts
- [buffer](./src/playbook/buffer/) folder as a temporary storage of transaction hashes and addresses
Expand Down
2 changes: 1 addition & 1 deletion packages/integration-tests/src/config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Wallets } from "./entities";
import { Wallets } from "./constants";

export const localConfig = {
gasLimit: { gasLimit: 10000000 },
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion packages/integration-tests/src/helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import * as request from "supertest";
import { Provider } from "zksync-web3";

import { environment, localConfig } from "./config";
import { Logger } from "./entities";
import { Logger } from "./constants";

import type { BaseProvider } from "@ethersproject/providers/src.ts/base-provider";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Deployer } from "@matterlabs/hardhat-zksync-deploy";
import { promises as fs } from "fs";

import { localConfig } from "../../config";
import { Buffer } from "../../entities";
import { Buffer } from "../../constants";
import getWallet from "../utils/getWallet";

import type { HardhatRuntimeEnvironment } from "hardhat/types";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import * as ethers from "ethers";
import { promises as fs } from "fs";
import { Wallet } from "zksync-web3";

import { Buffer, Wallets } from "../../entities";
import { Buffer, Wallets } from "../../constants";

import type { HardhatRuntimeEnvironment } from "hardhat/types";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { promises as fs } from "fs";
import { ethers } from "hardhat";

import { localConfig } from "../../config";
import { Buffer, Wallets } from "../../entities";
import { Buffer, Wallets } from "../../constants";

async function main() {
const [deployer] = await ethers.getSigners();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Deployer } from "@matterlabs/hardhat-zksync-deploy";
import { promises as fs } from "fs";

import { localConfig } from "../../config";
import { Buffer } from "../../entities";
import { Buffer } from "../../constants";
import getWallet from "../utils/getWallet";

import type { HardhatRuntimeEnvironment } from "hardhat/types";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Deployer } from "@matterlabs/hardhat-zksync-deploy";
import { promises as fs } from "fs";

import { Buffer, Wallets } from "../../entities";
import { Buffer, Wallets } from "../../constants";
import verify from "../utils/displayVerificationInfo";
import getWallet from "../utils/getWallet";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Deployer } from "@matterlabs/hardhat-zksync-deploy";
import { promises as fs } from "fs";

import { Buffer } from "../../entities";
import { Buffer } from "../../constants";
import { Helper } from "../../helper";
import getWallet from "../utils/getWallet";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Deployer } from "@matterlabs/hardhat-zksync-deploy";
import { promises as fs } from "fs";

import { Buffer } from "../../entities";
import { Buffer } from "../../constants";
import { Helper } from "../../helper";
import getWallet from "../utils/getWallet";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Deployer } from "@matterlabs/hardhat-zksync-deploy";
import { promises as fs } from "fs";

import { Buffer } from "../../entities";
import { Buffer } from "../../constants";
import getWallet from "../utils/getWallet";

import type { HardhatRuntimeEnvironment } from "hardhat/types";
Expand Down
2 changes: 1 addition & 1 deletion packages/integration-tests/src/playbook/deploy/nftToL1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { promises as fs } from "fs";
import { ethers } from "hardhat";
import * as hardhatConfig from "hardhat";

import { Buffer, Wallets } from "../../entities";
import { Buffer, Wallets } from "../../constants";

import type { HardhatRuntimeEnvironment } from "hardhat/types";

Expand Down
2 changes: 1 addition & 1 deletion packages/integration-tests/src/playbook/deploy/nftToL2.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Deployer } from "@matterlabs/hardhat-zksync-deploy";
import { promises as fs } from "fs";

import { Buffer, Wallets } from "../../entities";
import { Buffer, Wallets } from "../../constants";
import displayVerificationInfo from "../utils/displayVerificationInfo";
import getWallet from "../utils/getWallet";

Expand Down
4 changes: 2 additions & 2 deletions packages/integration-tests/src/playbook/deploy/use-greeter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import { promises as fs } from "fs";
import { Provider, Wallet } from "zksync-web3";

import { localConfig } from "../../config";
import { Wallets } from "../../entities";
import { Buffer } from "../../entities";
import { Wallets } from "../../constants";
import { Buffer } from "../../constants";
import { Helper } from "../../helper";

import type { HardhatRuntimeEnvironment } from "hardhat/types";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { promises as fs } from "fs";
import { Provider } from "zksync-web3";

import { localConfig } from "../../config";
import { Buffer } from "../../entities";
import { Buffer } from "../../constants";
import { Helper } from "../../helper";
import getWallet from "../utils/getWallet";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { promises as fs } from "fs";
import { Provider, Wallet } from "zksync-web3";

import { localConfig } from "../../config";
import { Buffer, Token, Wallets } from "../../entities";
import { Buffer, Token, Wallets } from "../../constants";
import { Helper } from "../../helper";

import type { HardhatRuntimeEnvironment } from "hardhat/types";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { promises as fs } from "fs";
import { Provider, utils, Wallet } from "zksync-web3";

import { localConfig } from "../../config";
import { Buffer } from "../../entities";
import { Buffer } from "../../constants";
import { Helper } from "../../helper";

import type { HardhatRuntimeEnvironment } from "hardhat/types";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Buffer, Logger } from "../../../entities";
import { Buffer, Logger } from "../../../constants";
import { Helper } from "../../../helper";

export const deployERC20toL1 = async function () {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Buffer, Logger } from "../../../entities";
import { Buffer, Logger } from "../../../constants";
import { Helper } from "../../../helper";

export const deployERC20toL2 = async function () {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Buffer, Logger } from "../../../entities";
import { Buffer, Logger } from "../../../constants";
import { Helper } from "../../../helper";

let deployedContract: string;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Buffer } from "../../../entities";
import { Buffer } from "../../../constants";
import { Helper } from "../../../helper";

export const deployMulticallContracts = async function () {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Buffer } from "../../../entities";
import { Buffer } from "../../../constants";
import { Helper } from "../../../helper";

export const deployMultitransferETH = async function () {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Buffer, Logger } from "../../../entities";
import { Buffer, Logger } from "../../../constants";
import { Helper } from "../../../helper";

export const deployNFTtoL1 = async function () {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Buffer, Logger } from "../../../entities";
import { Buffer, Logger } from "../../../constants";
import { Helper } from "../../../helper";

export const deployNFTtoL2 = async function () {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Buffer } from "../../../entities";
import { Buffer } from "../../../constants";
import { Helper } from "../../../helper";

export const deployViaPaymaster = async function () {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { promises as fs } from "fs";
import * as zksync from "zksync-web3";

import { localConfig } from "../../../config";
import { Buffer, Logger, Wallets } from "../../../entities";
import { Buffer, Logger, Wallets } from "../../../constants";
import { Helper } from "../../../helper";

const helper = new Helper();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { promises as fs } from "fs";
import * as zksync from "zksync-web3";

import { localConfig } from "../../../config";
import { Buffer, Logger } from "../../../entities";
import { Buffer, Logger } from "../../../constants";
import { Helper } from "../../../helper";

export const depositEth = async function (sum = "0.000009") {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { promises as fs } from "fs";
import * as zksync from "zksync-web3";

import { localConfig } from "../../../config";
import { Buffer, Logger, Wallets } from "../../../entities";
import { Buffer, Logger, Wallets } from "../../../constants";
import { Helper } from "../../../helper";

export const transferERC20 = async function (sum: string, tokenAddress: string, tokenName?: string /*, units = 18*/) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { promises as fs } from "fs";
import * as zksync from "zksync-web3";

import { localConfig } from "../../../config";
import { Buffer, Logger, Wallets } from "../../../entities";
import { Buffer, Logger, Wallets } from "../../../constants";
import { Helper } from "../../../helper";

export const transferEth = async function (sum = "0.000009", address: string = Wallets.mainWalletPrivateKey) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { promises as fs } from "fs";
import * as zksync from "zksync-web3";

import { localConfig } from "../../../config";
import { Buffer, Logger } from "../../../entities";
import { Buffer, Logger } from "../../../constants";
import { Helper } from "../../../helper";

export const transferFailedState = async function (tokenAddress: string, tokenName?: string) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Buffer } from "../../../entities";
import { Buffer } from "../../../constants";
import { Helper } from "../../../helper";

export const useGreeter = async function () {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Buffer } from "../../../entities";
import { Buffer } from "../../../constants";
import { Helper } from "../../../helper";

export const useMultiCallContracts = async function () {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Buffer } from "../../../entities";
import { Buffer } from "../../../constants";
import { Helper } from "../../../helper";

export const useMultitransferETH = async function () {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Buffer } from "../../../entities";
import { Buffer } from "../../../constants";
import { Helper } from "../../../helper";

export const usePaymaster = async function () {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { promises as fs } from "fs";
import * as zksync from "zksync-web3";

import { localConfig } from "../../../config";
import { Buffer, Logger, Wallets } from "../../../entities";
import { Buffer, Logger, Wallets } from "../../../constants";
import { Helper } from "../../../helper";

export const withdrawERC20 = async function (tokenAddress: string, sum = "0.2") {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { promises as fs } from "fs";
import * as zksync from "zksync-web3";

import { localConfig } from "../../../config";
import { Buffer, Logger, Wallets } from "../../../entities";
import { Buffer, Logger, Wallets } from "../../../constants";
import { Helper } from "../../../helper";

export const withdrawERC20toOtherAddress = async function (tokenAddress: string, sum = "0.2") {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { promises as fs } from "fs";
import * as zksync from "zksync-web3";

import { localConfig } from "../../../config";
import { Buffer, Logger } from "../../../entities";
import { Buffer, Logger } from "../../../constants";
import { Helper } from "../../../helper";

export const withdrawETH = async function (sum = "0.000009") {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { promises as fs } from "fs";
import * as zksync from "zksync-web3";

import { localConfig } from "../../../config";
import { Buffer, Logger, Wallets } from "../../../entities";
import { Buffer, Logger, Wallets } from "../../../constants";
import { Helper } from "../../../helper";

export const withdrawETHtoOtherAddress = async function (sum = "0.000009") {
Expand Down
2 changes: 1 addition & 1 deletion packages/integration-tests/src/playbook/utils/getWallet.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { getDefaultProvider, utils } from "ethers";
import { Provider, Wallet } from "zksync-web3";

import { Wallets } from "../../entities";
import { Wallets } from "../../constants";

// eslint-disable-next-line @typescript-eslint/no-explicit-any
export default async function (hre: any) {
Expand Down
2 changes: 1 addition & 1 deletion packages/integration-tests/tests/api/accounts.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import * as request from "supertest";

import { environment } from "../../src/config";
import { localConfig } from "../../src/config";
import { Buffer, Token, Wallets } from "../../src/entities";
import { Buffer, Token, Wallets } from "../../src/constants";
import { Helper } from "../../src/helper";
import { Playbook } from "../../src/playbook/playbook";

Expand Down
2 changes: 1 addition & 1 deletion packages/integration-tests/tests/api/addresses.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { localConfig } from "../../src/config";
import { Buffer, Token, Wallets } from "../../src/entities";
import { Buffer, Token, Wallets } from "../../src/constants";
import { Helper } from "../../src/helper";
import { Playbook } from "../../src/playbook/playbook";

Expand Down
2 changes: 1 addition & 1 deletion packages/integration-tests/tests/api/contracts.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { localConfig } from "../../src/config";
import { Buffer, Wallets } from "../../src/entities";
import { Buffer, Wallets } from "../../src/constants";
import { Helper } from "../../src/helper";
import { Playbook } from "../../src/playbook/playbook";

Expand Down
2 changes: 1 addition & 1 deletion packages/integration-tests/tests/api/logs.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { localConfig } from "../../src/config";
import { Buffer } from "../../src/entities";
import { Buffer } from "../../src/constants";
import { Helper } from "../../src/helper";
import { Playbook } from "../../src/playbook/playbook";

Expand Down
2 changes: 1 addition & 1 deletion packages/integration-tests/tests/api/tokens.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { localConfig } from "../../src/config";
import { Buffer, Token, TransactionsType, Wallets } from "../../src/entities";
import { Buffer, Token, TransactionsType, Wallets } from "../../src/constants";
import { Helper } from "../../src/helper";
import { Playbook } from "../../src/playbook/playbook";

Expand Down
2 changes: 1 addition & 1 deletion packages/integration-tests/tests/api/transactions.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { localConfig } from "../../src/config";
import { Buffer, Token, TransactionStatus, TransactionsType, Wallets } from "../../src/entities";
import { Buffer, Token, TransactionStatus, TransactionsType, Wallets } from "../../src/constants";
import { Helper } from "../../src/helper";
import { Playbook } from "../../src/playbook/playbook";

Expand Down
2 changes: 1 addition & 1 deletion packages/integration-tests/tests/hooks/global.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Buffer } from "../../src/entities";
import { Buffer } from "../../src/constants";
import { Helper } from "../../src/helper";
import { Playbook } from "../../src/playbook/playbook";

Expand Down
2 changes: 1 addition & 1 deletion packages/integration-tests/tests/ui/deposit.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { expect, test } from "@playwright/test";

import { config } from "./config";
import { BlockExplorer, Buffer, Wallets } from "../../src/entities";
import { BlockExplorer, Buffer, Wallets } from "../../src/constants";
import { Helper } from "../../src/helper";

import type { Locator } from "@playwright/test";
Expand Down
2 changes: 1 addition & 1 deletion packages/integration-tests/tests/ui/multiCall.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { expect, test } from "@playwright/test";

import { config } from "./config";
import { BlockExplorer, Buffer } from "../../src/entities";
import { BlockExplorer, Buffer } from "../../src/constants";
import { Helper } from "../../src/helper";

import type { Locator } from "@playwright/test";
Expand Down
2 changes: 1 addition & 1 deletion packages/integration-tests/tests/ui/nft.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { expect, test } from "@playwright/test";

import { config } from "./config";
import { BlockExplorer, Buffer } from "../../src/entities";
import { BlockExplorer, Buffer } from "../../src/constants";
import { Helper } from "../../src/helper";

import type { Locator } from "@playwright/test";
Expand Down
Loading

0 comments on commit 1380443

Please sign in to comment.