Skip to content

Commit

Permalink
test: repalce endpoints from old testsolution
Browse files Browse the repository at this point in the history
  • Loading branch information
pcheremu committed Jan 5, 2024
1 parent 533b4ed commit 42f96db
Show file tree
Hide file tree
Showing 2 changed files with 421 additions and 0 deletions.
19 changes: 19 additions & 0 deletions packages/integration-tests/src/helper.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import { execSync } from "child_process";
import { ethers } from "ethers";
import { promises as fs } from "fs";
import * as path from "path";
import { Provider } from "zksync-web3";

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

export class Helper {
Expand Down Expand Up @@ -35,4 +38,20 @@ export class Helper {
console.log(`There is no the expected file: ${fileName}`);
}
}

async getBalanceETH(walletAddress: string, layer: string) {
let network: any;
let provider: any;
if (layer == "L1") {
network = localConfig.L1Network;
provider = ethers.getDefaultProvider(network);
} else if (layer == "L2") {
network = localConfig.L2Network;
provider = new Provider(network);
} else {
console.log(`Wrong layer: ${layer}`);
}
const balanceEth = ethers.utils.formatUnits(await provider.getBalance(walletAddress), "wei");
return balanceEth;
}
}
Loading

0 comments on commit 42f96db

Please sign in to comment.