Skip to content

Commit 3e2ee89

Browse files
authored
Remove unused mock contracts from SafeToL2Migration tests (#837)
This pull request focuses on cleaning up the `SafeToL2Migration.spec.ts` test file by removing unused imports and redundant mock setup code. These changes streamline the test setup and improve code readability. Code cleanup and simplification: * Removed the unused `getMock` import from `test/libraries/SafeToL2Migration.spec.ts`. * Deleted the setup and usage of `validGuardMock` and `invalidGuardMock` in the `SafeToL2Migration` library tests, as they were not used in the actual tests. [[1]](diffhunk://#diff-75100fb7649ea61385b33880528c60fc7ed991face5d9285fa01ebaeb4616221L79-L86) [[2]](diffhunk://#diff-75100fb7649ea61385b33880528c60fc7ed991face5d9285fa01ebaeb4616221L116-L117)
1 parent 0796a37 commit 3e2ee89

File tree

1 file changed

+1
-11
lines changed

1 file changed

+1
-11
lines changed

test/libraries/SafeToL2Migration.spec.ts

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { expect } from "chai";
22
import hre, { ethers, deployments } from "hardhat";
33
import { AddressZero } from "@ethersproject/constants";
4-
import { getSafe, getSafeSingletonAt, getMock, getAbi, getSafeL2Singleton, getCompatFallbackHandler } from "../utils/setup";
4+
import { getSafe, getSafeSingletonAt, getAbi, getSafeL2Singleton, getCompatFallbackHandler } from "../utils/setup";
55
import deploymentData from "../json/safeDeployment.json";
66
import { Safe, SafeL2 } from "../../typechain-types";
77
import {
@@ -76,14 +76,6 @@ describe("SafeToL2Migration library", () => {
7676
const singleton130 = await getSafeSingletonAt(SAFE_SINGLETON_130_ADDRESS);
7777
const singleton141 = await getSafeSingletonAt(SAFE_SINGLETON_141_ADDRESS);
7878

79-
const guardContract = await hre.ethers.getContractAt("ITransactionGuard", AddressZero);
80-
const guardEip165Calldata = guardContract.interface.encodeFunctionData("supportsInterface", ["0xe6d7a83a"]);
81-
const validGuardMock = await getMock();
82-
await validGuardMock.givenCalldataReturnBool(guardEip165Calldata, true);
83-
84-
const invalidGuardMock = await getMock();
85-
await invalidGuardMock.givenCalldataReturnBool(guardEip165Calldata, false);
86-
8779
const safeWith1967Proxy = await getSafeSingletonAt(
8880
await hre.ethers
8981
.getContractFactory("UpgradeableProxy")
@@ -113,8 +105,6 @@ describe("SafeToL2Migration library", () => {
113105
safeWith1967Proxy,
114106
migration,
115107
signers,
116-
validGuardMock,
117-
invalidGuardMock,
118108
};
119109
});
120110

0 commit comments

Comments
 (0)