Skip to content

Commit

Permalink
Merge branch 'v-next' into edr-config-validation
Browse files Browse the repository at this point in the history
  • Loading branch information
schaable authored Jan 14, 2025
2 parents 4768d7d + 34e9feb commit c74a693
Show file tree
Hide file tree
Showing 70 changed files with 2,196 additions and 523 deletions.
1 change: 0 additions & 1 deletion .github/workflows/v-next-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ jobs:
[
".",
"packages/",
"v-next/example-project",
"v-next/hardhat/templates/"
]
COMMON_FILTERS: |
Expand Down
52 changes: 18 additions & 34 deletions pnpm-lock.yaml

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

18 changes: 18 additions & 0 deletions v-next/example-project/contracts/Counter.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,24 @@ contract CounterTest {
require(counter.x() == 0, "Initial value should be 0");
}

function testFailInitialValue() public view {
require(counter.x() == 1, "Initial value should be 1");
}

function testFuzzInc(uint8 x) public {
for (uint8 i = 0; i < x; i++) {
counter.inc();
}
require(counter.x() == x, "Value after calling inc x times should be x");
}

function testFailFuzzInc(uint8 x) public {
for (uint8 i = 0; i < x; i++) {
counter.inc();
}
require(counter.x() == x + 1, "Value after calling inc x times should be x + 1");
}

// function invariant() public pure {
// assert(true);
// }
Expand All @@ -47,6 +58,13 @@ contract FailingCounterTest {
);
}

function testFailFuzzInc(uint8 x) public {
for (uint8 i = 0; i < x; i++) {
counter.inc();
}
require(counter.x() == x, "Value after calling inc x times should be x");
}

// function invariant() public pure {
// assert(false);
// }
Expand Down
4 changes: 4 additions & 0 deletions v-next/example-project/hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ const config: HardhatUserConfig = {
tests: {
mocha: "test/mocha",
nodeTest: "test/node",
solidity: "test/contracts",
},
},
solidity: {
Expand Down Expand Up @@ -199,6 +200,9 @@ const config: HardhatUserConfig = {
"forge-std/=npm/[email protected]/src/",
],
},
solidityTest: {
testFail: true,
},
};

export default config;
6 changes: 4 additions & 2 deletions v-next/example-project/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@nomicfoundation/example-project",
"private": true,
"version": "3.0.0",
"version": "3.0.1",
"description": "Example project using Hardhat v3",
"homepage": "https://github.com/nomicfoundation/hardhat/tree/v-next/v-next/example-project",
"repository": {
Expand All @@ -17,7 +17,9 @@
"lint:fix": "pnpm prettier --write",
"prettier": "prettier \"**/*.{ts,js,md,json}\"",
"build": "tsc --build .",
"clean": "rimraf dist"
"clean": "rimraf dist",
"pretest": "pnpm build && pnpm install",
"test": "hardhat3 test node && hardhat3 test mocha"
},
"devDependencies": {
"@ignored/hardhat-vnext": "workspace:^3.0.0-next.16",
Expand Down
3 changes: 2 additions & 1 deletion v-next/hardhat-errors/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
"type": "module",
"types": "dist/src/index.d.ts",
"exports": {
".": "./dist/src/index.js"
".": "./dist/src/index.js",
"./package.json": "./package.json"
},
"keywords": [
"ethereum",
Expand Down
6 changes: 6 additions & 0 deletions v-next/hardhat-errors/src/descriptors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1189,6 +1189,12 @@ This happens when your files require incompatible versions of solc or you haven'
Please check Hardhat's output for more details.`,
},
INVALID_SOLCJS_COMPILER: {
number: 1231,
messageTemplate: `A wasm version of solc {version} is invalid. The compile function is not available.`,
websiteTitle: "Invalid solcjs compiler",
websiteDescription: `Hardhat successfully downloaded a WASM version of solc {version} but it is invalid. The compile function is missing.`,
},
},
VIEM: {
NETWORK_NOT_FOUND: {
Expand Down
1 change: 1 addition & 0 deletions v-next/hardhat-ethers/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"type": "module",
"exports": {
".": "./dist/src/index.js",
"./package.json": "./package.json",
"./types": "./dist/src/types.js"
},
"keywords": [
Expand Down
1 change: 1 addition & 0 deletions v-next/hardhat-ethers/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const hardhatEthersPlugin: HardhatPlugin = {
hookHandlers: {
network: import.meta.resolve("./internal/hook-handlers/network.js"),
},
npmPackage: "@ignored/hardhat-vnext-ethers",
};

export default hardhatEthersPlugin;
3 changes: 2 additions & 1 deletion v-next/hardhat-keystore/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
"license": "MIT",
"type": "module",
"exports": {
".": "./dist/src/index.js"
".": "./dist/src/index.js",
"./package.json": "./package.json"
},
"keywords": [
"keystore",
Expand Down
1 change: 1 addition & 0 deletions v-next/hardhat-keystore/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ const hardhatKeystorePlugin: HardhatPlugin = {
.setAction(import.meta.resolve("./internal/tasks/delete.js"))
.build(),
],
npmPackage: "@ignored/hardhat-vnext-keystore",
};

export default hardhatKeystorePlugin;
3 changes: 2 additions & 1 deletion v-next/hardhat-mocha-test-runner/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
"license": "MIT",
"type": "module",
"exports": {
".": "./dist/src/index.js"
".": "./dist/src/index.js",
"./package.json": "./package.json"
},
"keywords": [
"ethereum",
Expand Down
1 change: 1 addition & 0 deletions v-next/hardhat-mocha-test-runner/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ const hardhatPlugin: HardhatPlugin = {
hookHandlers: {
config: import.meta.resolve("./hookHandlers/config.js"),
},
npmPackage: "@ignored/hardhat-vnext-mocha-test-runner",
};

export default hardhatPlugin;
3 changes: 2 additions & 1 deletion v-next/hardhat-network-helpers/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
"types": "dist/src/index.d.ts",
"exports": {
".": "./dist/src/index.js",
"./types": "./dist/src/types.js"
"./types": "./dist/src/types.js",
"./package.json": "./package.json"
},
"keywords": [
"ethereum",
Expand Down
1 change: 1 addition & 0 deletions v-next/hardhat-network-helpers/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const hardhatNetworkHelpersPlugin: HardhatPlugin = {
hookHandlers: {
network: import.meta.resolve("./internal/hook-handlers/network.js"),
},
npmPackage: "@ignored/hardhat-vnext-network-helpers",
};

export default hardhatNetworkHelpersPlugin;
3 changes: 2 additions & 1 deletion v-next/hardhat-node-test-reporter/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
"license": "MIT",
"type": "module",
"exports": {
".": "./dist/src/reporter.js"
".": "./dist/src/reporter.js",
"./package.json": "./package.json"
},
"keywords": [
"ethereum",
Expand Down
3 changes: 2 additions & 1 deletion v-next/hardhat-node-test-runner/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
"license": "MIT",
"type": "module",
"exports": {
".": "./dist/src/index.js"
".": "./dist/src/index.js",
"./package.json": "./package.json"
},
"keywords": [
"ethereum",
Expand Down
1 change: 1 addition & 0 deletions v-next/hardhat-node-test-runner/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ const hardhatPlugin: HardhatPlugin = {
hookHandlers: {
config: import.meta.resolve("./hookHandlers/config.js"),
},
npmPackage: "@ignored/hardhat-vnext-node-test-runner",
};

export default hardhatPlugin;
3 changes: 2 additions & 1 deletion v-next/hardhat-test-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
"license": "MIT",
"type": "module",
"exports": {
".": "./dist/src/index.js"
".": "./dist/src/index.js",
"./package.json": "./package.json"
},
"scripts": {
"lint": "pnpm prettier --check && pnpm eslint",
Expand Down
Loading

0 comments on commit c74a693

Please sign in to comment.