Skip to content

Commit

Permalink
Remove all mentions to buidler (#778)
Browse files Browse the repository at this point in the history
  • Loading branch information
fvictorio committed Sep 21, 2023
1 parent b56f209 commit dea15cd
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 40 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ jobs:
- checkout
- <<: *step_install_nvm
- run:
name: Buidler & Hardhat E2E
name: Hardhat E2E
command: |
./scripts/run-nomiclabs.sh
workflows:
Expand Down
1 change: 0 additions & 1 deletion HARDHAT_README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
39 changes: 6 additions & 33 deletions plugins/resources/nomiclabs.utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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");
Expand Down Expand Up @@ -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){
Expand All @@ -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}
*/
Expand All @@ -277,7 +251,6 @@ module.exports = {
normalizeConfig,
finish,
tempCacheDir,
setupBuidlerNetwork,
setupHardhatNetwork,
getTestFilePaths,
setNetworkFrom,
Expand Down
2 changes: 1 addition & 1 deletion scripts/run-nomiclabs.sh
Original file line number Diff line number Diff line change
@@ -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
#

Expand Down

0 comments on commit dea15cd

Please sign in to comment.