diff --git a/.gitignore b/.gitignore index 0519f68..89ba3d8 100644 --- a/.gitignore +++ b/.gitignore @@ -64,13 +64,13 @@ typings/ .next # hardhat-project -test/hardhat-truffle-project/artifacts -test/hardhat-truffle-project/cache -test/hardhat-ethers-project/artifacts -test/hardhat-ethers-project/cache -test/hardhat-waffle-project/artifacts -test/hardhat-waffle-project/cache -test/hardhat-forked-project/artifacts -test/hardhat-forked-project/cache +test/projects/hardhat-truffle-project/artifacts +test/projects/hardhat-truffle-project/cache +test/projects/hardhat-ethers-project/artifacts +test/projects/hardhat-ethers-project/cache +test/projects/hardhat-waffle-project/artifacts +test/projects/hardhat-waffle-project/cache +test/projects/hardhat-forked-project/artifacts +test/projects/hardhat-forked-project/cache dist/ diff --git a/.mocharc.json b/.mocharc.json new file mode 100644 index 0000000..9ccdd7a --- /dev/null +++ b/.mocharc.json @@ -0,0 +1,7 @@ +{ + "require" : [ + "dotenv/config", + "ts-node/register", + "source-map-support/register" + ] +} diff --git a/package.json b/package.json index 1faed7a..5161b3d 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,7 @@ ], "devDependencies": { "@nomiclabs/hardhat-ethers": "^2.0.0", - "@nomiclabs/hardhat-truffle5": "^2.0.0", + "@nomiclabs/hardhat-truffle5": "^2.0.7", "@nomiclabs/hardhat-waffle": "^2.0.1", "@nomiclabs/hardhat-web3": "^2.0.0", "@types/chai": "^4.2.14", @@ -43,7 +43,6 @@ "dotenv": "^6.2.0", "ethereum-waffle": "^3.2.1", "ethers": "^5.0.0", - "ganache-cli": "^6.4.3", "hardhat": "^2.19.4", "mocha": "7", "prettier": "^1.17.0", diff --git a/scripts/run-tests.sh b/scripts/run-tests.sh index 9b6933f..91bed91 100755 --- a/scripts/run-tests.sh +++ b/scripts/run-tests.sh @@ -4,53 +4,37 @@ set -o errexit trap cleanup EXIT cleanup() { - if [ -n "$ganache_pid" ] && ps -p $ganache_pid > /dev/null; then - echo "Killing ganache." - kill -9 $ganache_pid + if [ -n "$hardhat_node_pid" ] && ps -p $hardhat_node_pid > /dev/null; then + echo "Killing Hardhat Node." + kill -9 $hardhat_node_pid fi - - if [ -n "$hardhatevm_pid" ] && ps -p $hardhatevm_pid > /dev/null; then - echo "Killing hardhatevm." - kill -9 $hardhatevm_pid - fi -} - -start_ganache() { - echo "Launching ganache..." - node_modules/.bin/ganache-cli > /dev/null & - ganache_pid=$! - sleep 4 } -start_hardhatevm() { - echo "Launching hardhatevm..." +start_hardhat_node() { + echo "Launching Hardhat Node..." node_modules/.bin/hardhat node > /dev/null & - hardhatevm_pid=$! + hardhat_node_pid=$! sleep 4 } -# Merge gasRerpoterOutput.json files task -npx mocha test/merge.ts - -# Truffle + HardhatEVM -npx mocha test/truffle.ts --timeout 100000 --exit - -# Truffle + HardhatEVM + misc reporterOptions -npx mocha test/truffle.options.ts --timeout 100000 --exit - -# Ethers + HardhatEVM -npx mocha test/ethers.ts --timeout 100000 --exit - -# Waffle + HardhatEVM -npx mocha test/waffle.ts --timeout 100000 --exit - -# Forked Network + HardhatEVM -npx mocha test/forked.ts --timeout 100000 --exit - -# Ethers + Hardhat Node -start_hardhatevm -npx mocha test/hardhatevm.node.ts --timeout 100000 --exit +######## +# Tasks +######## +npx mocha test/tasks/merge.ts + +################################ +# Hardhat EVM (Default Network) +################################ +npx mocha test/integration/truffle.ts --timeout 100000 --exit +npx mocha test/integration/options.ts --timeout 100000 --exit +npx mocha test/integration/ethers.ts --timeout 100000 --exit +npx mocha test/integration/waffle.ts --timeout 100000 --exit +npx mocha test/integration/forked.ts --timeout 100000 --exit + +########################## +# Hardhat Node (Localhost) +########################## +start_hardhat_node +npx mocha test/integration/node.ts --timeout 100000 --exit -# Waffle + Hardhat Node -npx mocha test/waffle.ts --timeout 100000 --exit cleanup diff --git a/test/ganache.node.ts b/test/ganache.node.ts deleted file mode 100644 index 4696eb6..0000000 --- a/test/ganache.node.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { TASK_TEST } from "hardhat/builtin-tasks/task-names"; -// tslint:disable-next-line no-implicit-dependencies -import { assert } from "chai"; - -import { useEnvironment } from "./helpers"; - -describe("Truffle plugin", function() { - useEnvironment(__dirname + "/hardhat-truffle-project", "development"); - - it("default", async function() { - await this.env.run(TASK_TEST, { testFiles: [] }); - }); -}); diff --git a/test/ethers.ts b/test/integration/ethers.ts similarity index 60% rename from test/ethers.ts rename to test/integration/ethers.ts index e2139d6..fb8c3b6 100644 --- a/test/ethers.ts +++ b/test/integration/ethers.ts @@ -1,10 +1,12 @@ +import path from "path" import { TASK_TEST } from "hardhat/builtin-tasks/task-names"; // tslint:disable-next-line no-implicit-dependencies import { assert } from "chai"; -import { useEnvironment } from "./helpers"; +import { useEnvironment } from "./../helpers"; describe("Ethers plugin", function() { - useEnvironment(__dirname + "/hardhat-ethers-project"); + const projectPath = path.resolve(__dirname, "../projects/hardhat-ethers-project"); + useEnvironment(projectPath); it("no options", async function() { await this.env.run(TASK_TEST, { testFiles: [] }); diff --git a/test/forked.ts b/test/integration/forked.ts similarity index 60% rename from test/forked.ts rename to test/integration/forked.ts index a068d97..c925a4c 100644 --- a/test/forked.ts +++ b/test/integration/forked.ts @@ -1,11 +1,13 @@ +import path from "path" import { TASK_TEST } from "hardhat/builtin-tasks/task-names"; // tslint:disable-next-line no-implicit-dependencies import { assert } from "chai"; -import { useEnvironment } from "./helpers"; +import { useEnvironment } from "./../helpers"; describe("Forked Network", function() { - useEnvironment(__dirname + "/hardhat-forked-project"); + const projectPath = path.resolve(__dirname, "../projects/hardhat-forked-project"); + useEnvironment(projectPath); it("default", async function() { await this.env.run(TASK_TEST, { testFiles: [] }); diff --git a/test/hardhatevm.node.ts b/test/integration/node.ts similarity index 59% rename from test/hardhatevm.node.ts rename to test/integration/node.ts index b029d74..4f6dc02 100644 --- a/test/hardhatevm.node.ts +++ b/test/integration/node.ts @@ -1,10 +1,12 @@ +import path from "path" import { TASK_TEST } from "hardhat/builtin-tasks/task-names"; // tslint:disable-next-line no-implicit-dependencies import { assert } from "chai"; -import { useEnvironment } from "./helpers"; +import { useEnvironment } from "./../helpers"; describe("Ethers plugin", function() { - useEnvironment(__dirname + "/hardhat-ethers-project", "localhost"); + const projectPath = path.resolve(__dirname, "../projects/hardhat-ethers-project"); + useEnvironment(projectPath, "localhost"); it("no options", async function() { await this.env.run(TASK_TEST, { testFiles: [] }); diff --git a/test/truffle.options.ts b/test/integration/options.ts similarity index 72% rename from test/truffle.options.ts rename to test/integration/options.ts index 74d1c9a..5cd7a5c 100644 --- a/test/truffle.options.ts +++ b/test/integration/options.ts @@ -1,12 +1,14 @@ +import path from "path" import { TASK_TEST } from "hardhat/builtin-tasks/task-names"; // tslint:disable-next-line no-implicit-dependencies import { assert } from "chai"; -import { useEnvironment } from "./helpers"; +import { useEnvironment } from "./../helpers"; // A place to test options describe("Truffle plugin: gasReporter", function() { - useEnvironment(__dirname + "/hardhat-truffle-project"); + const projectPath = path.resolve(__dirname, "../projects/hardhat-truffle-project"); + useEnvironment(projectPath); it("gasReporter options", async function() { // Expect everything in the EtherRouter folder to be missing from report diff --git a/test/truffle.ts b/test/integration/truffle.ts similarity index 60% rename from test/truffle.ts rename to test/integration/truffle.ts index 002a12a..96167e4 100644 --- a/test/truffle.ts +++ b/test/integration/truffle.ts @@ -1,11 +1,13 @@ +import path from "path" import { TASK_TEST } from "hardhat/builtin-tasks/task-names"; // tslint:disable-next-line no-implicit-dependencies import { assert } from "chai"; -import { useEnvironment } from "./helpers"; +import { useEnvironment } from "./../helpers"; describe("Truffle plugin", function() { - useEnvironment(__dirname + "/hardhat-truffle-project"); + const projectPath = path.resolve(__dirname, "../projects/hardhat-truffle-project"); + useEnvironment(projectPath); it("default", async function() { await this.env.run(TASK_TEST, { testFiles: [] }); diff --git a/test/waffle.ts b/test/integration/waffle.ts similarity index 61% rename from test/waffle.ts rename to test/integration/waffle.ts index 7079d0f..4ba500f 100644 --- a/test/waffle.ts +++ b/test/integration/waffle.ts @@ -1,10 +1,12 @@ +import path from "path" import { TASK_TEST } from "hardhat/builtin-tasks/task-names"; // tslint:disable-next-line no-implicit-dependencies import { assert } from "chai"; -import { useEnvironment } from "./helpers"; +import { useEnvironment } from "./../helpers"; describe("Waffle plugin with signers", function() { - useEnvironment(__dirname + "/hardhat-waffle-project"); + const projectPath = path.resolve(__dirname, "../projects/hardhat-waffle-project"); + useEnvironment(projectPath); it("no options", async function() { await this.env.run(TASK_TEST, { testFiles: [] }); diff --git a/test/mocha.opts b/test/mocha.opts deleted file mode 100644 index 1b619a4..0000000 --- a/test/mocha.opts +++ /dev/null @@ -1,3 +0,0 @@ ---require dotenv/config ---require ts-node/register ---require source-map-support/register diff --git a/test/hardhat-ethers-project/LICENSE b/test/projects/hardhat-ethers-project/LICENSE similarity index 100% rename from test/hardhat-ethers-project/LICENSE rename to test/projects/hardhat-ethers-project/LICENSE diff --git a/test/hardhat-ethers-project/contracts/Greeter.sol b/test/projects/hardhat-ethers-project/contracts/Greeter.sol similarity index 100% rename from test/hardhat-ethers-project/contracts/Greeter.sol rename to test/projects/hardhat-ethers-project/contracts/Greeter.sol diff --git a/test/hardhat-ethers-project/hardhat.config.ts b/test/projects/hardhat-ethers-project/hardhat.config.ts similarity index 90% rename from test/hardhat-ethers-project/hardhat.config.ts rename to test/projects/hardhat-ethers-project/hardhat.config.ts index 01b6a6c..6e026eb 100644 --- a/test/hardhat-ethers-project/hardhat.config.ts +++ b/test/projects/hardhat-ethers-project/hardhat.config.ts @@ -2,7 +2,7 @@ import { HardhatUserConfig } from "hardhat/types"; import "@nomiclabs/hardhat-ethers" -import "../../src/index"; +import "../../../src/index"; const config: HardhatUserConfig = { solidity: "0.5.8", diff --git a/test/hardhat-ethers-project/test/greeter.ts b/test/projects/hardhat-ethers-project/test/greeter.ts similarity index 100% rename from test/hardhat-ethers-project/test/greeter.ts rename to test/projects/hardhat-ethers-project/test/greeter.ts diff --git a/test/hardhat-forked-project/abi.ts b/test/projects/hardhat-forked-project/abi.ts similarity index 100% rename from test/hardhat-forked-project/abi.ts rename to test/projects/hardhat-forked-project/abi.ts diff --git a/test/hardhat-forked-project/contracts/WETH.sol b/test/projects/hardhat-forked-project/contracts/WETH.sol similarity index 100% rename from test/hardhat-forked-project/contracts/WETH.sol rename to test/projects/hardhat-forked-project/contracts/WETH.sol diff --git a/test/hardhat-forked-project/hardhat.config.ts b/test/projects/hardhat-forked-project/hardhat.config.ts similarity index 95% rename from test/hardhat-forked-project/hardhat.config.ts rename to test/projects/hardhat-forked-project/hardhat.config.ts index add4e08..7869ab2 100644 --- a/test/hardhat-forked-project/hardhat.config.ts +++ b/test/projects/hardhat-forked-project/hardhat.config.ts @@ -3,7 +3,7 @@ import { HardhatUserConfig } from "hardhat/types"; import "@nomiclabs/hardhat-ethers" import { ABI } from "./abi"; -import "../../src/index"; +import "../../../src/index"; const config: HardhatUserConfig = { solidity: "0.4.18", diff --git a/test/hardhat-forked-project/test/weth.ts b/test/projects/hardhat-forked-project/test/weth.ts similarity index 100% rename from test/hardhat-forked-project/test/weth.ts rename to test/projects/hardhat-forked-project/test/weth.ts diff --git a/test/hardhat-merge-project/.gitignore b/test/projects/hardhat-merge-project/.gitignore similarity index 100% rename from test/hardhat-merge-project/.gitignore rename to test/projects/hardhat-merge-project/.gitignore diff --git a/test/hardhat-merge-project/gasReporterOutput-0.json b/test/projects/hardhat-merge-project/gasReporterOutput-0.json similarity index 100% rename from test/hardhat-merge-project/gasReporterOutput-0.json rename to test/projects/hardhat-merge-project/gasReporterOutput-0.json diff --git a/test/hardhat-merge-project/gasReporterOutput-1.json b/test/projects/hardhat-merge-project/gasReporterOutput-1.json similarity index 100% rename from test/hardhat-merge-project/gasReporterOutput-1.json rename to test/projects/hardhat-merge-project/gasReporterOutput-1.json diff --git a/test/hardhat-merge-project/gasReporterOutput.expected.json b/test/projects/hardhat-merge-project/gasReporterOutput.expected.json similarity index 100% rename from test/hardhat-merge-project/gasReporterOutput.expected.json rename to test/projects/hardhat-merge-project/gasReporterOutput.expected.json diff --git a/test/hardhat-merge-project/hardhat.config.ts b/test/projects/hardhat-merge-project/hardhat.config.ts similarity index 85% rename from test/hardhat-merge-project/hardhat.config.ts rename to test/projects/hardhat-merge-project/hardhat.config.ts index ae6a519..f00bfaf 100644 --- a/test/hardhat-merge-project/hardhat.config.ts +++ b/test/projects/hardhat-merge-project/hardhat.config.ts @@ -1,7 +1,7 @@ // We load the plugin here. import { HardhatUserConfig } from "hardhat/types"; -import "../../src/index"; +import "../../../src/index"; const config: HardhatUserConfig = { solidity: "0.5.8", diff --git a/test/hardhat-truffle-project/contracts/ConvertLib.sol b/test/projects/hardhat-truffle-project/contracts/ConvertLib.sol similarity index 100% rename from test/hardhat-truffle-project/contracts/ConvertLib.sol rename to test/projects/hardhat-truffle-project/contracts/ConvertLib.sol diff --git a/test/hardhat-truffle-project/contracts/DuplicateA.sol b/test/projects/hardhat-truffle-project/contracts/DuplicateA.sol similarity index 100% rename from test/hardhat-truffle-project/contracts/DuplicateA.sol rename to test/projects/hardhat-truffle-project/contracts/DuplicateA.sol diff --git a/test/hardhat-truffle-project/contracts/DuplicateB.sol b/test/projects/hardhat-truffle-project/contracts/DuplicateB.sol similarity index 100% rename from test/hardhat-truffle-project/contracts/DuplicateB.sol rename to test/projects/hardhat-truffle-project/contracts/DuplicateB.sol diff --git a/test/hardhat-truffle-project/contracts/EtherRouter/EtherRouter.sol b/test/projects/hardhat-truffle-project/contracts/EtherRouter/EtherRouter.sol similarity index 100% rename from test/hardhat-truffle-project/contracts/EtherRouter/EtherRouter.sol rename to test/projects/hardhat-truffle-project/contracts/EtherRouter/EtherRouter.sol diff --git a/test/hardhat-truffle-project/contracts/EtherRouter/Factory.sol b/test/projects/hardhat-truffle-project/contracts/EtherRouter/Factory.sol similarity index 100% rename from test/hardhat-truffle-project/contracts/EtherRouter/Factory.sol rename to test/projects/hardhat-truffle-project/contracts/EtherRouter/Factory.sol diff --git a/test/hardhat-truffle-project/contracts/EtherRouter/Resolver.sol b/test/projects/hardhat-truffle-project/contracts/EtherRouter/Resolver.sol similarity index 100% rename from test/hardhat-truffle-project/contracts/EtherRouter/Resolver.sol rename to test/projects/hardhat-truffle-project/contracts/EtherRouter/Resolver.sol diff --git a/test/hardhat-truffle-project/contracts/EtherRouter/VersionA.sol b/test/projects/hardhat-truffle-project/contracts/EtherRouter/VersionA.sol similarity index 100% rename from test/hardhat-truffle-project/contracts/EtherRouter/VersionA.sol rename to test/projects/hardhat-truffle-project/contracts/EtherRouter/VersionA.sol diff --git a/test/hardhat-truffle-project/contracts/EtherRouter/VersionB.sol b/test/projects/hardhat-truffle-project/contracts/EtherRouter/VersionB.sol similarity index 100% rename from test/hardhat-truffle-project/contracts/EtherRouter/VersionB.sol rename to test/projects/hardhat-truffle-project/contracts/EtherRouter/VersionB.sol diff --git a/test/hardhat-truffle-project/contracts/MetaCoin.sol b/test/projects/hardhat-truffle-project/contracts/MetaCoin.sol similarity index 100% rename from test/hardhat-truffle-project/contracts/MetaCoin.sol rename to test/projects/hardhat-truffle-project/contracts/MetaCoin.sol diff --git a/test/hardhat-truffle-project/contracts/Migrations.sol b/test/projects/hardhat-truffle-project/contracts/Migrations.sol similarity index 100% rename from test/hardhat-truffle-project/contracts/Migrations.sol rename to test/projects/hardhat-truffle-project/contracts/Migrations.sol diff --git a/test/hardhat-truffle-project/contracts/MultiContractFile.sol b/test/projects/hardhat-truffle-project/contracts/MultiContractFile.sol similarity index 100% rename from test/hardhat-truffle-project/contracts/MultiContractFile.sol rename to test/projects/hardhat-truffle-project/contracts/MultiContractFile.sol diff --git a/test/hardhat-truffle-project/contracts/Undeployed.sol b/test/projects/hardhat-truffle-project/contracts/Undeployed.sol similarity index 100% rename from test/hardhat-truffle-project/contracts/Undeployed.sol rename to test/projects/hardhat-truffle-project/contracts/Undeployed.sol diff --git a/test/hardhat-truffle-project/contracts/VariableConstructor.sol b/test/projects/hardhat-truffle-project/contracts/VariableConstructor.sol similarity index 100% rename from test/hardhat-truffle-project/contracts/VariableConstructor.sol rename to test/projects/hardhat-truffle-project/contracts/VariableConstructor.sol diff --git a/test/hardhat-truffle-project/contracts/VariableCosts.sol b/test/projects/hardhat-truffle-project/contracts/VariableCosts.sol similarity index 100% rename from test/hardhat-truffle-project/contracts/VariableCosts.sol rename to test/projects/hardhat-truffle-project/contracts/VariableCosts.sol diff --git a/test/hardhat-truffle-project/contracts/Wallets/Wallet.sol b/test/projects/hardhat-truffle-project/contracts/Wallets/Wallet.sol similarity index 100% rename from test/hardhat-truffle-project/contracts/Wallets/Wallet.sol rename to test/projects/hardhat-truffle-project/contracts/Wallets/Wallet.sol diff --git a/test/hardhat-truffle-project/hardhat.config.ts b/test/projects/hardhat-truffle-project/hardhat.config.ts similarity index 94% rename from test/hardhat-truffle-project/hardhat.config.ts rename to test/projects/hardhat-truffle-project/hardhat.config.ts index 03c9ec7..1b7c2e5 100644 --- a/test/hardhat-truffle-project/hardhat.config.ts +++ b/test/projects/hardhat-truffle-project/hardhat.config.ts @@ -2,7 +2,7 @@ import "@nomiclabs/hardhat-truffle5" import { HardhatUserConfig } from "hardhat/types"; // We load the plugin here. -import "../../src/index"; +import "../../../src/index"; const config: HardhatUserConfig = { solidity: { diff --git a/test/hardhat-truffle-project/test/duplicatenames.js b/test/projects/hardhat-truffle-project/test/duplicatenames.js similarity index 100% rename from test/hardhat-truffle-project/test/duplicatenames.js rename to test/projects/hardhat-truffle-project/test/duplicatenames.js diff --git a/test/hardhat-truffle-project/test/etherrouter.js b/test/projects/hardhat-truffle-project/test/etherrouter.js similarity index 100% rename from test/hardhat-truffle-project/test/etherrouter.js rename to test/projects/hardhat-truffle-project/test/etherrouter.js diff --git a/test/hardhat-truffle-project/test/metacoin.js b/test/projects/hardhat-truffle-project/test/metacoin.js similarity index 100% rename from test/hardhat-truffle-project/test/metacoin.js rename to test/projects/hardhat-truffle-project/test/metacoin.js diff --git a/test/hardhat-truffle-project/test/multicontract.js b/test/projects/hardhat-truffle-project/test/multicontract.js similarity index 100% rename from test/hardhat-truffle-project/test/multicontract.js rename to test/projects/hardhat-truffle-project/test/multicontract.js diff --git a/test/hardhat-truffle-project/test/variableconstructor.js b/test/projects/hardhat-truffle-project/test/variableconstructor.js similarity index 100% rename from test/hardhat-truffle-project/test/variableconstructor.js rename to test/projects/hardhat-truffle-project/test/variableconstructor.js diff --git a/test/hardhat-truffle-project/test/variablecosts.js b/test/projects/hardhat-truffle-project/test/variablecosts.js similarity index 100% rename from test/hardhat-truffle-project/test/variablecosts.js rename to test/projects/hardhat-truffle-project/test/variablecosts.js diff --git a/test/hardhat-truffle-project/test/wallet.js b/test/projects/hardhat-truffle-project/test/wallet.js similarity index 100% rename from test/hardhat-truffle-project/test/wallet.js rename to test/projects/hardhat-truffle-project/test/wallet.js diff --git a/test/hardhat-waffle-project/contracts/Greeter.sol b/test/projects/hardhat-waffle-project/contracts/Greeter.sol similarity index 100% rename from test/hardhat-waffle-project/contracts/Greeter.sol rename to test/projects/hardhat-waffle-project/contracts/Greeter.sol diff --git a/test/hardhat-waffle-project/hardhat.config.ts b/test/projects/hardhat-waffle-project/hardhat.config.ts similarity index 87% rename from test/hardhat-waffle-project/hardhat.config.ts rename to test/projects/hardhat-waffle-project/hardhat.config.ts index af9eedd..506600a 100644 --- a/test/hardhat-waffle-project/hardhat.config.ts +++ b/test/projects/hardhat-waffle-project/hardhat.config.ts @@ -2,7 +2,7 @@ import { HardhatUserConfig } from "hardhat/types"; import "@nomiclabs/hardhat-waffle"; -import "../../src/index"; +import "../../../src/index"; const config: HardhatUserConfig = { solidity: "0.5.8", diff --git a/test/hardhat-waffle-project/test/greeter.ts b/test/projects/hardhat-waffle-project/test/greeter.ts similarity index 100% rename from test/hardhat-waffle-project/test/greeter.ts rename to test/projects/hardhat-waffle-project/test/greeter.ts diff --git a/test/merge.ts b/test/tasks/merge.ts similarity index 78% rename from test/merge.ts rename to test/tasks/merge.ts index 461752c..5689d6b 100644 --- a/test/merge.ts +++ b/test/tasks/merge.ts @@ -1,14 +1,14 @@ import fs from "fs" import path from "path" -import { TASK_GAS_REPORTER_MERGE } from "../src/task-names"; +import { TASK_GAS_REPORTER_MERGE } from "../../src/task-names"; // tslint:disable-next-line no-implicit-dependencies import { assert } from "chai"; -import { useEnvironment } from "./helpers"; +import { useEnvironment } from "./../helpers"; const loadJsonFile = (filepath) => JSON.parse(fs.readFileSync(filepath, "utf-8")) describe("Merge gasRerpoterOutput.json files task", function() { - const projectPath = path.resolve(__dirname, "hardhat-merge-project"); + const projectPath = path.resolve(__dirname, "../projects/hardhat-merge-project"); useEnvironment(projectPath); diff --git a/test/unit/.placeholder b/test/unit/.placeholder new file mode 100644 index 0000000..329f221 --- /dev/null +++ b/test/unit/.placeholder @@ -0,0 +1 @@ +// placeholder \ No newline at end of file diff --git a/yarn.lock b/yarn.lock index 3a572bb..810428b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1494,14 +1494,14 @@ version "2.0.0" resolved "https://registry.yarnpkg.com/@nomiclabs/hardhat-ethers/-/hardhat-ethers-2.0.0.tgz#ebab032b3aed03945ea560f56bb67aec56a30cbc" -"@nomiclabs/hardhat-truffle5@^2.0.0": - version "2.0.0" - resolved "https://registry.yarnpkg.com/@nomiclabs/hardhat-truffle5/-/hardhat-truffle5-2.0.0.tgz#1363b7f4f90e3d5b049d22e5e6d3519ba1b91fdf" +"@nomiclabs/hardhat-truffle5@^2.0.7": + version "2.0.7" + resolved "https://registry.yarnpkg.com/@nomiclabs/hardhat-truffle5/-/hardhat-truffle5-2.0.7.tgz#7519eadd2c6c460c2addc3d4d6efda7a8883361e" dependencies: "@nomiclabs/truffle-contract" "^4.2.23" "@types/chai" "^4.2.0" chai "^4.2.0" - ethereumjs-util "^6.1.0" + ethereumjs-util "^7.1.4" fs-extra "^7.0.1" "@nomiclabs/hardhat-waffle@^2.0.1": @@ -2686,7 +2686,7 @@ binary-extensions@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-2.0.0.tgz#23c0df14f6a88077f5f986c0d167ec03c3d5537c" -bindings@^1.2.1, bindings@^1.5.0: +bindings@^1.5.0: version "1.5.0" resolved "https://registry.yarnpkg.com/bindings/-/bindings-1.5.0.tgz#10353c9e945334bc0511a6d90b38fbc7c9c504df" dependencies: @@ -3416,7 +3416,7 @@ cross-fetch@^2.1.0, cross-fetch@^2.1.1: node-fetch "^2.6.7" whatwg-fetch "^2.0.4" -cross-spawn@^6.0.0, cross-spawn@^6.0.5: +cross-spawn@^6.0.5: version "6.0.5" resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-6.0.5.tgz#4a5ec7c64dfae22c3a14124dbacdee846d80cbc4" dependencies: @@ -4240,18 +4240,6 @@ ethereumjs-tx@^1.1.1, ethereumjs-tx@^1.2.0, ethereumjs-tx@^1.2.2, ethereumjs-tx@ ethereum-common "^0.0.18" ethereumjs-util "^5.0.0" -ethereumjs-util@6.1.0: - version "6.1.0" - resolved "https://registry.yarnpkg.com/ethereumjs-util/-/ethereumjs-util-6.1.0.tgz#e9c51e5549e8ebd757a339cc00f5380507e799c8" - dependencies: - bn.js "^4.11.0" - create-hash "^1.1.2" - ethjs-util "0.1.6" - keccak "^1.0.2" - rlp "^2.0.0" - safe-buffer "^5.1.1" - secp256k1 "^3.0.1" - ethereumjs-util@6.2.1, ethereumjs-util@^6.1.0, ethereumjs-util@^6.2.0, ethereumjs-util@^6.2.1: version "6.2.1" resolved "https://registry.yarnpkg.com/ethereumjs-util/-/ethereumjs-util-6.2.1.tgz#fcb4e4dd5ceacb9d2305426ab1a5cd93e3163b69" @@ -4309,6 +4297,16 @@ ethereumjs-util@^7.0.2: ethjs-util "0.1.6" rlp "^2.2.4" +ethereumjs-util@^7.1.4: + version "7.1.5" + resolved "https://registry.yarnpkg.com/ethereumjs-util/-/ethereumjs-util-7.1.5.tgz#9ecf04861e4fbbeed7465ece5f23317ad1129181" + dependencies: + "@types/bn.js" "^5.1.0" + bn.js "^5.1.2" + create-hash "^1.1.2" + ethereum-cryptography "^0.1.3" + rlp "^2.2.4" + ethereumjs-vm@4.2.0: version "4.2.0" resolved "https://registry.yarnpkg.com/ethereumjs-vm/-/ethereumjs-vm-4.2.0.tgz#e885e861424e373dbc556278f7259ff3fca5edab" @@ -4529,18 +4527,6 @@ evp_bytestokey@^1.0.0, evp_bytestokey@^1.0.3: md5.js "^1.3.4" safe-buffer "^5.1.1" -execa@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/execa/-/execa-1.0.0.tgz#c6236a5bb4df6d6f15e88e7f017798216749ddd8" - dependencies: - cross-spawn "^6.0.0" - get-stream "^4.0.0" - is-stream "^1.1.0" - npm-run-path "^2.0.0" - p-finally "^1.0.0" - signal-exit "^3.0.0" - strip-eof "^1.0.0" - exit-on-epipe@~1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/exit-on-epipe/-/exit-on-epipe-1.0.1.tgz#0bdd92e87d5285d267daa8171d0eb06159689692" @@ -4859,14 +4845,6 @@ functional-red-black-tree@^1.0.1, functional-red-black-tree@~1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz#1b0ab3bd553b2a0d6399d29c0e3ea0b252078327" -ganache-cli@^6.4.3: - version "6.9.1" - resolved "https://registry.yarnpkg.com/ganache-cli/-/ganache-cli-6.9.1.tgz#1e13eee098fb9f19b031a191ec3f62ae926ea8b3" - dependencies: - ethereumjs-util "6.1.0" - source-map-support "0.5.12" - yargs "13.2.4" - ganache-core@^2.10.2: version "2.13.1" resolved "https://registry.yarnpkg.com/ganache-core/-/ganache-core-2.13.1.tgz#bf60399a2dd084e1090db91cbbc7ed3885dc01e4" @@ -4931,7 +4909,7 @@ get-stream@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-3.0.0.tgz#8e943d1358dc37555054ecbe2edb05aa174ede14" -get-stream@^4.0.0, get-stream@^4.1.0: +get-stream@^4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-4.1.0.tgz#c1b255575f3dc21d59bfc79cd3d2b46b1c3a54b5" dependencies: @@ -5379,10 +5357,6 @@ invert-kv@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/invert-kv/-/invert-kv-1.0.0.tgz#104a8e4aaca6d3d8cd157a8ef8bfab2d7a3ffdb6" -invert-kv@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/invert-kv/-/invert-kv-2.0.0.tgz#7393f5afa59ec9ff5f67a27620d11c226e3eec02" - io-ts@1.10.4: version "1.10.4" resolved "https://registry.yarnpkg.com/io-ts/-/io-ts-1.10.4.tgz#cd5401b138de88e4f920adbcb7026e2d1967e6e2" @@ -5589,7 +5563,7 @@ is-retry-allowed@^1.0.0: version "1.2.0" resolved "https://registry.yarnpkg.com/is-retry-allowed/-/is-retry-allowed-1.2.0.tgz#d778488bd0a4666a3be8a1482b9f2baafedea8b4" -is-stream@^1.0.0, is-stream@^1.0.1, is-stream@^1.1.0: +is-stream@^1.0.0, is-stream@^1.0.1: version "1.1.0" resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44" @@ -5797,15 +5771,6 @@ keccak@3.0.1, keccak@^3.0.0: node-addon-api "^2.0.0" node-gyp-build "^4.2.0" -keccak@^1.0.2: - version "1.4.0" - resolved "https://registry.yarnpkg.com/keccak/-/keccak-1.4.0.tgz#572f8a6dbee8e7b3aa421550f9e6408ca2186f80" - dependencies: - bindings "^1.2.1" - inherits "^2.0.3" - nan "^2.2.1" - safe-buffer "^5.1.0" - keccak@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/keccak/-/keccak-2.1.0.tgz#734ea53f2edcfd0f42cdb8d5f4c358fef052752b" @@ -5867,12 +5832,6 @@ lcid@^1.0.0: dependencies: invert-kv "^1.0.0" -lcid@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/lcid/-/lcid-2.0.0.tgz#6ef5d2df60e52f82eb228a4c373e8d1f397253cf" - dependencies: - invert-kv "^2.0.0" - level-codec@^9.0.0: version "9.0.2" resolved "https://registry.yarnpkg.com/level-codec/-/level-codec-9.0.2.tgz#fd60df8c64786a80d44e63423096ffead63d8cbc" @@ -6140,12 +6099,6 @@ make-error@^1.1.1: version "1.3.6" resolved "https://registry.yarnpkg.com/make-error/-/make-error-1.3.6.tgz#2eb2e37ea9b67c4891f684a1394799af484cf7a2" -map-age-cleaner@^0.1.1: - version "0.1.3" - resolved "https://registry.yarnpkg.com/map-age-cleaner/-/map-age-cleaner-0.1.3.tgz#7d583a7306434c055fe474b0f45078e6e1b4b92a" - dependencies: - p-defer "^1.0.0" - map-cache@^0.2.2: version "0.2.2" resolved "https://registry.yarnpkg.com/map-cache/-/map-cache-0.2.2.tgz#c32abd0bd6525d9b051645bb4f26ac5dc98a0dbf" @@ -6178,14 +6131,6 @@ media-typer@0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/media-typer/-/media-typer-0.3.0.tgz#8710d7af0aa626f8fffa1ce00168545263255748" -mem@^4.0.0: - version "4.3.0" - resolved "https://registry.yarnpkg.com/mem/-/mem-4.3.0.tgz#461af497bc4ae09608cdb2e60eefb69bff744178" - dependencies: - map-age-cleaner "^0.1.1" - mimic-fn "^2.0.0" - p-is-promise "^2.0.0" - memdown@^1.0.0: version "1.4.1" resolved "https://registry.yarnpkg.com/memdown/-/memdown-1.4.1.tgz#b4e4e192174664ffbae41361aa500f3119efe215" @@ -6302,10 +6247,6 @@ mime@1.6.0: version "1.6.0" resolved "https://registry.yarnpkg.com/mime/-/mime-1.6.0.tgz#32cd9e5c64553bd58d19a568af452acff04981b1" -mimic-fn@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-2.1.0.tgz#7ed2c2ccccaf84d3ffcb7a69b57711fc2083401b" - mimic-response@^1.0.0, mimic-response@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/mimic-response/-/mimic-response-1.0.1.tgz#4923538878eef42063cb8a3e3b0798781487ab1b" @@ -6501,7 +6442,7 @@ multihashes@^0.4.15, multihashes@~0.4.15: multibase "^0.7.0" varint "^5.0.0" -nan@^2.14.0, nan@^2.2.1: +nan@^2.14.0: version "2.14.1" resolved "https://registry.yarnpkg.com/nan/-/nan-2.14.1.tgz#d7be34dfa3105b91494c3147089315eff8874b01" @@ -6602,12 +6543,6 @@ normalize-url@^4.1.0: version "4.5.1" resolved "https://registry.yarnpkg.com/normalize-url/-/normalize-url-4.5.1.tgz#0dd90cf1288ee1d1313b87081c9a5932ee48518a" -npm-run-path@^2.0.0: - version "2.0.2" - resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-2.0.2.tgz#35a9232dfa35d7067b4cb2ddf2357b1871536c5f" - dependencies: - path-key "^2.0.0" - nth-check@~1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/nth-check/-/nth-check-1.0.2.tgz#b2bd295c37e3dd58a3bf0700376663ba4d9cf05c" @@ -6743,14 +6678,6 @@ os-locale@^1.4.0: dependencies: lcid "^1.0.0" -os-locale@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/os-locale/-/os-locale-3.1.0.tgz#a802a6ee17f24c10483ab9935719cef4ed16bf1a" - dependencies: - execa "^1.0.0" - lcid "^2.0.0" - mem "^4.0.0" - os-tmpdir@^1.0.1, os-tmpdir@~1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" @@ -6763,18 +6690,10 @@ p-cancelable@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/p-cancelable/-/p-cancelable-1.1.0.tgz#d078d15a3af409220c886f1d9a0ca2e441ab26cc" -p-defer@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/p-defer/-/p-defer-1.0.0.tgz#9f6eb182f6c9aa8cd743004a7d4f96b196b0fb0c" - p-finally@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/p-finally/-/p-finally-1.0.0.tgz#3fbcfb15b899a44123b34b6dcc18b724336a2cae" -p-is-promise@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/p-is-promise/-/p-is-promise-2.1.0.tgz#918cebaea248a62cf7ffab8e3bca8c5f882fc42e" - p-limit@^1.1.0: version "1.3.0" resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-1.3.0.tgz#b86bd5f0c25690911c7590fcbfc2010d54b3ccb8" @@ -6923,7 +6842,7 @@ path-is-absolute@^1.0.0, path-is-absolute@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" -path-key@^2.0.0, path-key@^2.0.1: +path-key@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/path-key/-/path-key-2.0.1.tgz#411cadb574c5a140d3a4b1910d40d80cc9f40b40" @@ -7668,10 +7587,6 @@ side-channel@^1.0.4: get-intrinsic "^1.0.2" object-inspect "^1.9.0" -signal-exit@^3.0.0: - version "3.0.3" - resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.3.tgz#a1410c2edd8f077b08b4e253c8eacfcaf057461c" - simple-concat@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/simple-concat/-/simple-concat-1.0.1.tgz#f46976082ba35c2263f1c8ab5edfe26c41c9552f" @@ -8009,10 +7924,6 @@ strip-bom@^2.0.0: dependencies: is-utf8 "^0.2.0" -strip-eof@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/strip-eof/-/strip-eof-1.0.0.tgz#bb43ff5598a6eb05d89b59fcd129c983313606bf" - strip-hex-prefix@1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/strip-hex-prefix/-/strip-hex-prefix-1.0.0.tgz#0c5f155fef1151373377de9dbb588da05500e36f" @@ -9394,7 +9305,7 @@ yallist@^3.0.0, yallist@^3.0.2, yallist@^3.0.3: version "3.1.1" resolved "https://registry.yarnpkg.com/yallist/-/yallist-3.1.1.tgz#dbb7daf9bfd8bac9ab45ebf602b8cbad0d5d08fd" -yargs-parser@13.1.2, yargs-parser@^13.1.0, yargs-parser@^13.1.2: +yargs-parser@13.1.2, yargs-parser@^13.1.2: version "13.1.2" resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-13.1.2.tgz#130f09702ebaeef2650d54ce6e3e5706f7a4fb38" dependencies: @@ -9433,22 +9344,6 @@ yargs-unparser@2.0.0: flat "^5.0.2" is-plain-obj "^2.1.0" -yargs@13.2.4: - version "13.2.4" - resolved "https://registry.yarnpkg.com/yargs/-/yargs-13.2.4.tgz#0b562b794016eb9651b98bd37acf364aa5d6dc83" - dependencies: - cliui "^5.0.0" - find-up "^3.0.0" - get-caller-file "^2.0.1" - os-locale "^3.1.0" - require-directory "^2.1.1" - require-main-filename "^2.0.0" - set-blocking "^2.0.0" - string-width "^3.0.0" - which-module "^2.0.0" - y18n "^4.0.0" - yargs-parser "^13.1.0" - yargs@13.3.2, yargs@^13.3.0: version "13.3.2" resolved "https://registry.yarnpkg.com/yargs/-/yargs-13.3.2.tgz#ad7ffefec1aa59565ac915f82dccb38a9c31a2dd"