Skip to content

Commit

Permalink
fix linting
Browse files Browse the repository at this point in the history
  • Loading branch information
MexicanAce committed Sep 22, 2023
1 parent 46bb057 commit c7d9e73
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 45 deletions.
9 changes: 2 additions & 7 deletions e2e-tests/test/evm-apis.test copy.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import { expect } from "chai";
import {
getTestProvider,
} from "../helpers/utils";
import { getTestProvider } from "../helpers/utils";

const provider = getTestProvider();

Expand All @@ -12,10 +10,7 @@ xdescribe("evm_mine", function () {
const startingBlock = await provider.getBlock("latest");

// Act
await provider.send(
"evm_mine",
[]
);
await provider.send("evm_mine", []);

// Assert
const latestBlock = await provider.getBlock("latest");
Expand Down
68 changes: 30 additions & 38 deletions e2e-tests/test/hardhat-apis.test.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import { expect } from "chai";
import { Wallet } from "zksync-web3";
import {
getTestProvider,
} from "../helpers/utils";
import { getTestProvider } from "../helpers/utils";
import { RichAccounts } from "../helpers/constants";
import { ethers } from "hardhat";

Expand All @@ -15,13 +13,10 @@ describe("hardhat_setBalance", function () {
const newBalance = ethers.utils.parseEther("42");

// Act
await provider.send(
"hardhat_setBalance",
[
userWallet.address,
newBalance._hex,
]
);
await provider.send("hardhat_setBalance", [
userWallet.address,
newBalance._hex,
]);

// Assert
const balance = await userWallet.getBalance();
Expand All @@ -36,13 +31,10 @@ describe("hardhat_setNonce", function () {
const newNonce = 42;

// Act
await provider.send(
"hardhat_setNonce",
[
userWallet.address,
ethers.utils.hexlify(newNonce),
]
);
await provider.send("hardhat_setNonce", [
userWallet.address,
ethers.utils.hexlify(newNonce),
]);

// Assert
const nonce = await userWallet.getNonce();
Expand All @@ -59,18 +51,21 @@ xdescribe("hardhat_mine", function () {
const startingBlock = await provider.getBlock("latest");

// Act
await provider.send(
"hardhat_mine",
[
ethers.utils.hexlify(numberOfBlocks),
ethers.utils.hexlify(intervalInSeconds),
]
);
await provider.send("hardhat_mine", [
ethers.utils.hexlify(numberOfBlocks),
ethers.utils.hexlify(intervalInSeconds),
]);

// Assert
const latestBlock = await provider.getBlock("latest");
expect(latestBlock.number).to.equal(startingBlock.number + numberOfBlocks, "Block number mismatch");
expect(latestBlock.timestamp).to.equal(startingBlock.timestamp + (numberOfBlocks * intervalInSeconds * 1000), "Timestamp mismatch");
expect(latestBlock.number).to.equal(
startingBlock.number + numberOfBlocks,
"Block number mismatch"
);
expect(latestBlock.timestamp).to.equal(
startingBlock.timestamp + numberOfBlocks * intervalInSeconds * 1000,
"Timestamp mismatch"
);
});
});

Expand All @@ -81,17 +76,10 @@ xdescribe("hardhat_impersonateAccount & hardhat_stopImpersonatingAccount", funct
const userWallet = Wallet.createRandom().connect(provider);
const beforeBalance = await provider.getBalance(RichAccounts[0].Account);

const actionToTransferWithoutPrivateKey = async () => {

};

// Act
await provider.send(
"hardhat_impersonateAccount",
[
RichAccounts[0].Account,
]
);
await provider.send("hardhat_impersonateAccount", [
RichAccounts[0].Account,
]);

const signer = await ethers.getSigner(RichAccounts[0].Account);
const tx = {
Expand All @@ -103,7 +91,11 @@ xdescribe("hardhat_impersonateAccount & hardhat_stopImpersonatingAccount", funct
await recieptTx.wait();

// Assert
expect(await userWallet.getBalance()).to.equal(ethers.utils.parseEther("0.42"));
expect(await provider.getBalance(RichAccounts[0].Account)).to.equal(beforeBalance.sub(0.42));
expect(await userWallet.getBalance()).to.equal(
ethers.utils.parseEther("0.42")
);
expect(await provider.getBalance(RichAccounts[0].Account)).to.equal(
beforeBalance.sub(0.42)
);
});
});

0 comments on commit c7d9e73

Please sign in to comment.