Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add skeleton EDR Solidity Testing integration #5780

Merged
merged 6 commits into from
Oct 1, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 66 additions & 0 deletions pnpm-lock.yaml

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

10 changes: 10 additions & 0 deletions v-next/example-project/contracts/Counter.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

contract Counter {
uint public x;

function inc() public {
x++;
}
}
21 changes: 21 additions & 0 deletions v-next/example-project/contracts/Counter.t.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import "./Counter.sol";

contract CounterTest {
Counter counter;

function setUp() public {
counter = new Counter();
}

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

function testInc() public {
counter.inc();
require(counter.x() == 1, "Value after inc should be 1");
}
}
13 changes: 13 additions & 0 deletions v-next/hardhat-errors/src/descriptors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,11 @@ export const ERROR_CATEGORIES: {
max: 999,
websiteTitle: "Network-helpers errors",
},
SOLIDITY_TESTS: {
min: 1000,
max: 1099,
websiteTitle: "Solidity tests errors",
},
};

export const ERRORS = {
Expand Down Expand Up @@ -685,4 +690,12 @@ This might be caused by using hardhat_reset and loadFixture calls in a testcase.
websiteDescription: "Error while reverting snapshot",
},
},
SOLIDITY_TESTS: {
BUILD_INFO_NOT_FOUND_FOR_CONTRACT: {
number: 1000,
messageTemplate: `Build info not found for contract {fqn}`,
websiteTitle: `Build info not found for contract`,
websiteDescription: `Build info not found for contract while compiling Solidity test contracts.`,
},
},
} as const;
1 change: 1 addition & 0 deletions v-next/hardhat/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@
"typescript-eslint": "7.7.1"
},
"dependencies": {
"@ignored/edr": "0.6.2-alpha.0",
"@ignored/hardhat-vnext-build-system": "workspace:^3.0.0-next.2",
"@ignored/hardhat-vnext-errors": "workspace:^3.0.0-next.2",
"@ignored/hardhat-vnext-utils": "workspace:^3.0.0-next.2",
Expand Down
Loading