Skip to content

Commit

Permalink
An attempt to fix flaky zksync test
Browse files Browse the repository at this point in the history
- Upgraded several development dependencies related to Hardhat and zkSync:
  - `@matterlabs/hardhat-zksync-deploy` from `^1.5.0` to `^1.6.0`
  - `@matterlabs/hardhat-zksync-node` from `^1.1.1` to `^1.2.1`
  - `@matterlabs/hardhat-zksync-verify` from `^1.6.0` to `^1.7.1`
  - `zksync-ethers` from `6.12.1` to `6.15.3`
- Refactored the test setup in `SafeToL2Setup.spec.ts` to retrieve the deployed contract instance using `getContractAt` instead of deploying a new instance, enhancing test reliability and efficiency.
  • Loading branch information
mmv08 committed Jan 10, 2025
1 parent 7e760ef commit ad011ee
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 28 deletions.
49 changes: 26 additions & 23 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,11 @@
},
"devDependencies": {
"@eslint/js": "^9.9.1",
"@matterlabs/hardhat-zksync-deploy": "^1.5.0",
"@matterlabs/hardhat-zksync-deploy": "^1.6.0",
"@matterlabs/hardhat-zksync-ethers": "^1.2.1",
"@matterlabs/hardhat-zksync-node": "^1.1.1",
"@matterlabs/hardhat-zksync-node": "^1.2.1",
"@matterlabs/hardhat-zksync-solc": "^1.2.4",
"@matterlabs/hardhat-zksync-verify": "^1.6.0",
"@matterlabs/hardhat-zksync-verify": "^1.7.1",
"@nomicfoundation/hardhat-toolbox": "^5.0.0",
"@openzeppelin/contracts": "^3.4.0",
"@safe-global/mock-contract": "^4.1.0",
Expand Down Expand Up @@ -92,6 +92,6 @@
"typescript": "^5.5.4",
"typescript-eslint": "^8.4.0",
"yargs": "^17.7.2",
"zksync-ethers": "6.12.1"
"zksync-ethers": "6.15.3"
}
}
3 changes: 2 additions & 1 deletion test/libraries/SafeToL2Setup.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ type HardhatTrace = {
describe("SafeToL2Setup", () => {
const setupTests = deployments.createFixture(async ({ deployments }) => {
await deployments.fixture();
const safeToL2SetupLib = await (await hre.ethers.getContractFactory("SafeToL2Setup")).deploy();
const safeToL2SetupAddress = (await deployments.get("SafeToL2Setup")).address;
const safeToL2SetupLib = await hre.ethers.getContractAt("SafeToL2Setup", safeToL2SetupAddress);
const signers = await hre.ethers.getSigners();
const safeSingleton = await getSafeSingleton();
const safeL2 = await getSafeL2Singleton();
Expand Down

0 comments on commit ad011ee

Please sign in to comment.