Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
6 changes: 6 additions & 0 deletions test/integration/projects/solc-8/.solcover.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = {
silent: process.env.SILENT ? true : false,
skipFiles: ['skipped-folder'],
istanbulReporter: ['json-summary', 'text'],
configureYulOptimizer: true
}
20 changes: 20 additions & 0 deletions test/integration/projects/solc-8/contracts/Contract_solc8.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.0 <0.9.0;
pragma abicoder v2;

error InvalidSomeAddress(address someAddress);

contract ContractA {

address public someAddress;

function throwError(address _add) external {
this;

if (_add == address(0)) {
revert InvalidSomeAddress(_add);
}

someAddress = _add;
}
}
9 changes: 9 additions & 0 deletions test/integration/projects/solc-8/hardhat.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
require("@nomiclabs/hardhat-truffle5");
require(__dirname + "/../plugins/nomiclabs.plugin");

module.exports = {
solidity: {
version: "0.8.5"
},
logger: process.env.SILENT ? { log: () => {} } : console,
};
13 changes: 13 additions & 0 deletions test/integration/projects/solc-8/test/test_solc8.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
const ContractA = artifacts.require("ContractA");

contract("contracta", function(accounts) {
let a,b;

before(async () => {
a = await ContractA.new();
})

it('a:throwError', async function(){
await a.throwError(a.address);
});
});
16 changes: 16 additions & 0 deletions test/units/hardhat/standard.js
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,22 @@ describe('Hardhat Plugin: standard use cases', function() {
verify.lineCoverage(expected);
})

it('solc 0.8.x', async function(){
mock.installFullProject('solc-8');
mock.hardhatSetupEnv(this);

await this.env.run("coverage");

const expectedLine = [
{
file: mock.pathToContract(hardhatConfig, 'Contract_solc8.sol'),
pct: 75
},
];

verify.lineCoverage(expectedLine);
});

// This test freezes when gas-reporter is not disabled
it('disables hardhat-gas-reporter', async function() {
mock.installFullProject('hardhat-gas-reporter');
Expand Down