From dea15cd82570de37b61370a071120f312ec5dac6 Mon Sep 17 00:00:00 2001 From: Franco Victorio Date: Fri, 22 Sep 2023 00:59:49 +0200 Subject: [PATCH] Remove all mentions to buidler (#778) --- .circleci/config.yml | 2 +- HARDHAT_README.md | 1 - README.md | 5 ++-- docs/api.md | 2 +- plugins/resources/nomiclabs.utils.js | 39 +++++----------------------- scripts/run-nomiclabs.sh | 2 +- 6 files changed, 11 insertions(+), 40 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 21e06f9..d23ced2 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -56,7 +56,7 @@ jobs: - checkout - <<: *step_install_nvm - run: - name: Buidler & Hardhat E2E + name: Hardhat E2E command: | ./scripts/run-nomiclabs.sh workflows: diff --git a/HARDHAT_README.md b/HARDHAT_README.md index f182a53..7043bd0 100644 --- a/HARDHAT_README.md +++ b/HARDHAT_README.md @@ -128,7 +128,6 @@ More documentation, including FAQ and information about solidity-coverage's API [29]: https://github.com/sc-forks/solidity-coverage/blob/master/docs/upgrade.md#upgrading-from-06x-to-070 [30]: https://github.com/sc-forks/solidity-coverage/tree/0.6.x-final#solidity-coverage [31]: https://github.com/sc-forks/solidity-coverage/releases/tag/v0.7.0 -[32]: https://github.com/sc-forks/buidler-e2e/tree/coverage [33]: https://github.com/sc-forks/moloch [34]: https://github.com/sc-forks/solidity-coverage/blob/master/docs/advanced.md#reducing-the-instrumentation-footprint diff --git a/README.md b/README.md index ebed427..6b9d6cc 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ ![npm (tag)](https://img.shields.io/npm/v/solidity-coverage/latest) [![CircleCI](https://circleci.com/gh/sc-forks/solidity-coverage.svg?style=svg)][20] [![codecov](https://codecov.io/gh/sc-forks/solidity-coverage/branch/master/graph/badge.svg)][21] -[![buidler](https://buidler.dev/buidler-plugin-badge.svg?1)][26] +[![Hardhat](https://hardhat.org/buidler-plugin-badge.svg?1)][26] ## Code coverage for Solidity testing @@ -197,13 +197,12 @@ $ yarn [23]: https://github.com/sc-forks/solidity-coverage/blob/master/docs/advanced.md#workflow-hooks [24]: https://github.com/sc-forks/solidity-coverage/blob/master/docs/advanced.md#skipping-tests [25]: https://github.com/sc-forks/solidity-coverage/issues/417 -[26]: https://buidler.dev/ +[26]: https://hardhat.org/ [27]: https://www.trufflesuite.com/docs [28]: https://github.com/sc-forks/solidity-coverage/blob/master/docs/api.md [29]: https://github.com/sc-forks/solidity-coverage/blob/master/docs/upgrade.md#upgrading-from-06x-to-070 [30]: https://github.com/sc-forks/solidity-coverage/tree/0.6.x-final#solidity-coverage [31]: https://github.com/sc-forks/solidity-coverage/releases/tag/v0.7.0 -[32]: https://github.com/sc-forks/buidler-e2e/tree/coverage [33]: https://github.com/sc-forks/moloch [34]: https://github.com/sc-forks/solidity-coverage/blob/master/docs/advanced.md#reducing-the-instrumentation-footprint [35]: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/e5fbbda9bac49039847a7ed20c1d966766ecc64a/scripts/coverage.js diff --git a/docs/api.md b/docs/api.md index 5143f20..309546c 100644 --- a/docs/api.md +++ b/docs/api.md @@ -20,7 +20,7 @@ table below shows how its core methods relate to the stages of a test run: disposable set of contracts/artifacts which coverage must use in lieu of the 'real' (uninstrumented) contracts. -+ there are two complete [coverage tool/plugin implementations][5] (for Buidler and Truffle) ++ there are two complete [coverage tool/plugin implementations][5] (for Hardhat and Truffle) which can be used as sources if you're building something similar. [5]: https://github.com/sc-forks/solidity-coverage/tree/master/plugins diff --git a/plugins/resources/nomiclabs.utils.js b/plugins/resources/nomiclabs.utils.js index 8221b0d..0212a54 100644 --- a/plugins/resources/nomiclabs.utils.js +++ b/plugins/resources/nomiclabs.utils.js @@ -18,16 +18,16 @@ const util = require('util') function getTestFilePaths(files){ const target = globby.sync([files]) - // Buidler/Hardhat supports js & ts + // Hardhat supports js & ts const testregex = /.*\.(js|ts)$/; return target.filter(f => f.match(testregex) != null); } /** - * Normalizes Buidler/Hardhat paths / logging for use by the plugin utilities and + * Normalizes Hardhat paths / logging for use by the plugin utilities and * attaches them to the config - * @param {Buidler/HardhatConfig} config - * @return {Buidler/HardhatConfig} updated config + * @param {HardhatConfig} config + * @return {HardhatConfig} updated config */ function normalizeConfig(config, args={}){ config.workingDir = config.paths.root; @@ -49,32 +49,6 @@ function normalizeConfig(config, args={}){ return config; } -function setupBuidlerNetwork(env, api, ui){ - const { createProvider } = require("@nomiclabs/buidler/internal/core/providers/construction"); - - let networkConfig = {}; - - let networkName = (env.buidlerArguments.network !== 'buidlerevm') - ? env.buidlerArguments.network - : api.defaultNetworkName; - - if (networkName !== api.defaultNetworkName){ - networkConfig = env.config.networks[networkName]; - configureHttpProvider(networkConfig, api, ui) - } else { - networkConfig.url = `http://${api.host}:${api.port}` - } - - const provider = createProvider(networkName, networkConfig); - - return configureNetworkEnv( - env, - networkName, - networkConfig, - provider - ) -} - async function setupHardhatNetwork(env, api, ui){ const hardhatPackage = require('hardhat/package.json'); const { createProvider } = require("hardhat/internal/core/providers/construction"); @@ -244,7 +218,7 @@ function setNetworkFrom(networkConfig, accounts){ // TODO: Hardhat cacheing?? /** * Generates a path to a temporary compilation cache directory - * @param {BuidlerConfig} config + * @param {HardhatConfig} config * @return {String} .../.coverage_cache */ function tempCacheDir(config){ @@ -253,7 +227,7 @@ function tempCacheDir(config){ /** * Silently removes temporary folders and calls api.finish to shut server down - * @param {Buidler/HardhatConfig} config + * @param {HardhatConfig} config * @param {SolidityCoverage} api * @return {Promise} */ @@ -277,7 +251,6 @@ module.exports = { normalizeConfig, finish, tempCacheDir, - setupBuidlerNetwork, setupHardhatNetwork, getTestFilePaths, setNetworkFrom, diff --git a/scripts/run-nomiclabs.sh b/scripts/run-nomiclabs.sh index 6153d78..6569854 100755 --- a/scripts/run-nomiclabs.sh +++ b/scripts/run-nomiclabs.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash # -# E2E CI: installs PR candidate on sc-forks/buidler-e2e (a simple example, +# E2E CI: installs PR candidate on sc-forks/hardhat-e2e (a simple example, # similar to Metacoin) and runs coverage #