Skip to content

Commit 95b012a

Browse files
authored
Merge branch 'v-next' into config-override-rework
2 parents 311d549 + 7e815f5 commit 95b012a

File tree

74 files changed

+2244
-555
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+2244
-555
lines changed

.github/workflows/v-next-ci.yml

-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@ jobs:
7777
[
7878
".",
7979
"packages/",
80-
"v-next/example-project",
8180
"v-next/hardhat/templates/"
8281
]
8382
COMMON_FILTERS: |

pnpm-lock.yaml

+18-34
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

v-next/example-project/contracts/Counter.t.sol

+18
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,24 @@ contract CounterTest {
1414
require(counter.x() == 0, "Initial value should be 0");
1515
}
1616

17+
function testFailInitialValue() public view {
18+
require(counter.x() == 1, "Initial value should be 1");
19+
}
20+
1721
function testFuzzInc(uint8 x) public {
1822
for (uint8 i = 0; i < x; i++) {
1923
counter.inc();
2024
}
2125
require(counter.x() == x, "Value after calling inc x times should be x");
2226
}
2327

28+
function testFailFuzzInc(uint8 x) public {
29+
for (uint8 i = 0; i < x; i++) {
30+
counter.inc();
31+
}
32+
require(counter.x() == x + 1, "Value after calling inc x times should be x + 1");
33+
}
34+
2435
// function invariant() public pure {
2536
// assert(true);
2637
// }
@@ -47,6 +58,13 @@ contract FailingCounterTest {
4758
);
4859
}
4960

61+
function testFailFuzzInc(uint8 x) public {
62+
for (uint8 i = 0; i < x; i++) {
63+
counter.inc();
64+
}
65+
require(counter.x() == x, "Value after calling inc x times should be x");
66+
}
67+
5068
// function invariant() public pure {
5169
// assert(false);
5270
// }

v-next/example-project/hardhat.config.ts

+4
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,7 @@ const config: HardhatUserConfig = {
163163
tests: {
164164
mocha: "test/mocha",
165165
nodeTest: "test/node",
166+
solidity: "test/contracts",
166167
},
167168
},
168169
solidity: {
@@ -199,6 +200,9 @@ const config: HardhatUserConfig = {
199200
"forge-std/=npm/[email protected]/src/",
200201
],
201202
},
203+
solidityTest: {
204+
testFail: true,
205+
},
202206
};
203207

204208
export default config;

v-next/example-project/package.json

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@nomicfoundation/example-project",
33
"private": true,
4-
"version": "3.0.0",
4+
"version": "3.0.1",
55
"description": "Example project using Hardhat v3",
66
"homepage": "https://github.com/nomicfoundation/hardhat/tree/v-next/v-next/example-project",
77
"repository": {
@@ -17,7 +17,9 @@
1717
"lint:fix": "pnpm prettier --write",
1818
"prettier": "prettier \"**/*.{ts,js,md,json}\"",
1919
"build": "tsc --build .",
20-
"clean": "rimraf dist"
20+
"clean": "rimraf dist",
21+
"pretest": "pnpm build && pnpm install",
22+
"test": "hardhat3 test node && hardhat3 test mocha"
2123
},
2224
"devDependencies": {
2325
"@ignored/hardhat-vnext": "workspace:^3.0.0-next.16",

v-next/hardhat-errors/package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313
"type": "module",
1414
"types": "dist/src/index.d.ts",
1515
"exports": {
16-
".": "./dist/src/index.js"
16+
".": "./dist/src/index.js",
17+
"./package.json": "./package.json"
1718
},
1819
"keywords": [
1920
"ethereum",

v-next/hardhat-errors/src/descriptors.ts

+6
Original file line numberDiff line numberDiff line change
@@ -1189,6 +1189,12 @@ This happens when your files require incompatible versions of solc or you haven'
11891189
11901190
Please check Hardhat's output for more details.`,
11911191
},
1192+
INVALID_SOLCJS_COMPILER: {
1193+
number: 1231,
1194+
messageTemplate: `A wasm version of solc {version} is invalid. The compile function is not available.`,
1195+
websiteTitle: "Invalid solcjs compiler",
1196+
websiteDescription: `Hardhat successfully downloaded a WASM version of solc {version} but it is invalid. The compile function is missing.`,
1197+
},
11921198
},
11931199
VIEM: {
11941200
NETWORK_NOT_FOUND: {

v-next/hardhat-ethers/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
"type": "module",
1414
"exports": {
1515
".": "./dist/src/index.js",
16+
"./package.json": "./package.json",
1617
"./types": "./dist/src/types.js"
1718
},
1819
"keywords": [

v-next/hardhat-ethers/src/index.ts

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ const hardhatEthersPlugin: HardhatPlugin = {
77
hookHandlers: {
88
network: import.meta.resolve("./internal/hook-handlers/network.js"),
99
},
10+
npmPackage: "@ignored/hardhat-vnext-ethers",
1011
};
1112

1213
export default hardhatEthersPlugin;

v-next/hardhat-keystore/package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
"license": "MIT",
1313
"type": "module",
1414
"exports": {
15-
".": "./dist/src/index.js"
15+
".": "./dist/src/index.js",
16+
"./package.json": "./package.json"
1617
},
1718
"keywords": [
1819
"keystore",

v-next/hardhat-keystore/src/index.ts

+1
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ const hardhatKeystorePlugin: HardhatPlugin = {
6161
.setAction(import.meta.resolve("./internal/tasks/delete.js"))
6262
.build(),
6363
],
64+
npmPackage: "@ignored/hardhat-vnext-keystore",
6465
};
6566

6667
export default hardhatKeystorePlugin;

v-next/hardhat-mocha-test-runner/package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
"license": "MIT",
1313
"type": "module",
1414
"exports": {
15-
".": "./dist/src/index.js"
15+
".": "./dist/src/index.js",
16+
"./package.json": "./package.json"
1617
},
1718
"keywords": [
1819
"ethereum",

v-next/hardhat-mocha-test-runner/src/index.ts

+1
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ const hardhatPlugin: HardhatPlugin = {
3232
hookHandlers: {
3333
config: import.meta.resolve("./hookHandlers/config.js"),
3434
},
35+
npmPackage: "@ignored/hardhat-vnext-mocha-test-runner",
3536
};
3637

3738
export default hardhatPlugin;

v-next/hardhat-network-helpers/package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
"types": "dist/src/index.d.ts",
1515
"exports": {
1616
".": "./dist/src/index.js",
17-
"./types": "./dist/src/types.js"
17+
"./types": "./dist/src/types.js",
18+
"./package.json": "./package.json"
1819
},
1920
"keywords": [
2021
"ethereum",

v-next/hardhat-network-helpers/src/index.ts

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ const hardhatNetworkHelpersPlugin: HardhatPlugin = {
77
hookHandlers: {
88
network: import.meta.resolve("./internal/hook-handlers/network.js"),
99
},
10+
npmPackage: "@ignored/hardhat-vnext-network-helpers",
1011
};
1112

1213
export default hardhatNetworkHelpersPlugin;

v-next/hardhat-node-test-reporter/package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
"license": "MIT",
1313
"type": "module",
1414
"exports": {
15-
".": "./dist/src/reporter.js"
15+
".": "./dist/src/reporter.js",
16+
"./package.json": "./package.json"
1617
},
1718
"keywords": [
1819
"ethereum",

v-next/hardhat-node-test-runner/package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
"license": "MIT",
1313
"type": "module",
1414
"exports": {
15-
".": "./dist/src/index.js"
15+
".": "./dist/src/index.js",
16+
"./package.json": "./package.json"
1617
},
1718
"keywords": [
1819
"ethereum",

v-next/hardhat-node-test-runner/src/index.ts

+1
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ const hardhatPlugin: HardhatPlugin = {
3232
hookHandlers: {
3333
config: import.meta.resolve("./hookHandlers/config.js"),
3434
},
35+
npmPackage: "@ignored/hardhat-vnext-node-test-runner",
3536
};
3637

3738
export default hardhatPlugin;

v-next/hardhat-test-utils/package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313
"license": "MIT",
1414
"type": "module",
1515
"exports": {
16-
".": "./dist/src/index.js"
16+
".": "./dist/src/index.js",
17+
"./package.json": "./package.json"
1718
},
1819
"scripts": {
1920
"lint": "pnpm prettier --check && pnpm eslint",

0 commit comments

Comments
 (0)