Skip to content

Commit d9fdda9

Browse files
nlordellmmv08claude
authored
Bump Hardhat Toolbox to v6 (#1002)
This is a follow up to #1000, where we finally bump the hardhat toolbox verion to v6. Notable the _only_ change that that entails is going from `hardhat-gas-reporter` `~1` to `~2`, which enables the gas reporting by default. After some more digging, I found that simply disbling the gas reporting would cause tests to no longer fail (with it enabled, it would fail with errors: "calling done() twice on test" and "cannot index property to on undefined"). I narrowed the issue down to a specific test, which is now disabled when gas reporting is on. Furthermore, I disabled gas reporting by default, as I find it quite noisy. To run tests with a gas report: ```sh HARDHAT_ENABLE_GAS_REPORTER=1 npm test ``` --------- Co-authored-by: Mikhail <16622558+mmv08@users.noreply.github.com> Co-authored-by: Claude <noreply@anthropic.com>
1 parent 285dd4f commit d9fdda9

File tree

3 files changed

+11
-7
lines changed

3 files changed

+11
-7
lines changed

hardhat.config.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,9 @@ const {
3030
PK,
3131
SOLIDITY_VERSION,
3232
SOLIDITY_SETTINGS,
33-
HARDHAT_ENABLE_ZKSYNC = "0",
3433
HARDHAT_CHAIN_ID = 31337,
34+
HARDHAT_ENABLE_ZKSYNC,
35+
HARDHAT_ENABLE_GAS_REPORTER,
3536
} = process.env;
3637

3738
const DEFAULT_MNEMONIC = "candy maple cake sugar pudding cream honey rich smooth crumble sweet treat";
@@ -170,6 +171,9 @@ const userConfig: HardhatUserConfig = {
170171
etherscan: {
171172
apiKey: ETHERSCAN_API_KEY,
172173
},
174+
gasReporter: {
175+
enabled: HARDHAT_ENABLE_GAS_REPORTER === "1",
176+
},
173177
};
174178
if (NODE_URL) {
175179
userConfig.networks!.custom = {

test/libraries/SafeToL2Migration.spec.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -334,13 +334,13 @@ describe("SafeToL2Migration library", () => {
334334
const guardBeforeMigration = await hre.ethers.provider.getStorage(safeAddress, GUARD_STORAGE_SLOT);
335335
const fallbackHandlerBeforeMigration = await hre.ethers.provider.getStorage(safeAddress, FALLBACK_HANDLER_STORAGE_SLOT);
336336

337-
await expect(
338-
executeContractCallWithSigners(safe130, migration, "migrateToL2", [await singleton130l2.getAddress()], [user1], true),
339-
);
337+
await executeContractCallWithSigners(safe130, migration, "migrateToL2", [await singleton130l2.getAddress()], [user1], true);
340338

341339
expect(await hre.ethers.provider.getStorage(safeAddress, 3)).to.be.eq(ownerCountBeforeMigration);
342340
expect(await hre.ethers.provider.getStorage(safeAddress, 4)).to.be.eq(thresholdBeforeMigration);
343-
expect(await hre.ethers.provider.getStorage(safeAddress, 5)).to.be.eq(nonceBeforeMigration);
341+
expect(await hre.ethers.provider.getStorage(safeAddress, 5)).to.be.eq(
342+
hre.ethers.toBeHex(BigInt(nonceBeforeMigration) + 1n, 32),
343+
);
344344
expect(await hre.ethers.provider.getStorage(safeAddress, GUARD_STORAGE_SLOT)).to.be.eq(guardBeforeMigration);
345345
expect(await hre.ethers.provider.getStorage(safeAddress, FALLBACK_HANDLER_STORAGE_SLOT)).to.be.eq(
346346
fallbackHandlerBeforeMigration,

test/libraries/SafeToL2Setup.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,11 +130,11 @@ describe("SafeToL2Setup", () => {
130130
).to.be.rejectedWith("Safe must have not executed any tx");
131131
});
132132

133-
it("changes the expected storage slot without touching the most important ones", async () => {
133+
it("changes the expected storage slot without touching the most important ones", async function () {
134134
if (hre.network.zksync) {
135135
// zksync doesn't support hardhat style traces
136136
// and their traces only include calls without the storage changes
137-
return;
137+
this.skip();
138138
}
139139

140140
const {

0 commit comments

Comments
 (0)