Skip to content
This repository has been archived by the owner on Dec 12, 2023. It is now read-only.

Commit

Permalink
Merge pull request #3 from matter-labs/lyova-dependencies
Browse files Browse the repository at this point in the history
Bump dependencies and setup dependabot
  • Loading branch information
ly0va authored May 16, 2022
2 parents cffcc7b + 333f3c2 commit 61b6118
Show file tree
Hide file tree
Showing 6 changed files with 651 additions and 1,088 deletions.
6 changes: 6 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version: 2
updates:
- package-ecosystem: "npm"
directory: "/local-setup-testing"
schedule:
interval: "daily"
2 changes: 2 additions & 0 deletions local-setup-testing/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
artifacts/
artifacts-zk/
cache/
cache-zk/
node_modules/
5 changes: 5 additions & 0 deletions local-setup-testing/hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,9 @@ module.exports = {
solidity: {
version: "0.8.11",
},
networks: {
hardhat: {
zksync: true
},
},
};
8 changes: 4 additions & 4 deletions local-setup-testing/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@
"main": "index.js",
"license": "MIT",
"devDependencies": {
"@matterlabs/hardhat-zksync-deploy": "^0.1.3",
"@matterlabs/hardhat-zksync-solc": "^0.2.3",
"@matterlabs/hardhat-zksync-deploy": "^0.2.0",
"@matterlabs/hardhat-zksync-solc": "^0.3.2",
"@types/chai": "^4.3.0",
"@types/mocha": "^9.1.0",
"chai": "^4.3.6",
"ethers": "^5.5.4",
"hardhat": "^2.8.4",
"mocha": "^9.2.1",
"mocha": "^10.0.0",
"ts-node": "^10.5.0",
"typescript": "^4.5.5",
"zksync-web3": "^0.3.5"
"zksync-web3": "^0.4.0"
},
"scripts": {
"test": "NODE_ENV=test hardhat test"
Expand Down
21 changes: 15 additions & 6 deletions local-setup-testing/test/main.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { expect } from 'chai';
import { Wallet, Provider, Contract } from 'zksync-web3';
import { Wallet, Contract, utils } from 'zksync-web3';
import * as hre from 'hardhat';
import { ethers } from 'ethers';
import { Deployer } from "@matterlabs/hardhat-zksync-deploy";

const RICH_WALLET_PK = '0x7726827caac94a7f9e1b160f7ea819f172f7b6f9d2a97f992c38edeab82d4110';
Expand All @@ -11,18 +12,26 @@ async function deployGreeter(deployer: Deployer): Promise<Contract> {
}

describe("Greeter", function () {
it("Should return the new greeting once it's changed", async function () {
const provider = Provider.getDefaultProvider();
let deployer: Deployer;

const wallet = new Wallet(RICH_WALLET_PK, provider);
const deployer = new Deployer(hre, wallet);
before("Fund the wallet", async () => {
deployer = new Deployer(hre, new Wallet(RICH_WALLET_PK));

const depositHandle = await deployer.zkWallet.deposit({
to: deployer.zkWallet.address,
token: utils.ETH_ADDRESS,
amount: ethers.utils.parseEther('0.001'),
});

await depositHandle.wait();
});

it("Should return the new greeting once it's changed", async () => {
const greeter = await deployGreeter(deployer);

expect(await greeter.greet()).to.eq("Hi");;

const setGreetingTx = await greeter.setGreeting("Hola, mundo!");
// wait until the transaction is mined
await setGreetingTx.wait();

expect(await greeter.greet()).to.equal("Hola, mundo!");
Expand Down
Loading

0 comments on commit 61b6118

Please sign in to comment.