From eb952c3cadfee8330fefd545eeecd547d32efc1a Mon Sep 17 00:00:00 2001 From: Daniel Kronovet Date: Tue, 18 Jun 2024 11:48:13 -0400 Subject: [PATCH] Consolidate .solcover config files --- .solcover.extensions.js | 5 ----- .solcover.reputation.js | 5 ----- .solcover.chainid.js => .solcover/chainid.js | 4 ++-- .solcover.crosschain.js => .solcover/crosschain.js | 5 ++--- .solcover/extensions.js | 5 +++++ .solcover/reputation.js | 5 +++++ .solcover.js => .solcover/solcover.js | 2 +- .solcover.upgrade.js => .solcover/upgrade.js | 5 +++-- package.json | 14 +++++++------- 9 files changed, 25 insertions(+), 25 deletions(-) delete mode 100644 .solcover.extensions.js delete mode 100644 .solcover.reputation.js rename .solcover.chainid.js => .solcover/chainid.js (81%) rename .solcover.crosschain.js => .solcover/crosschain.js (84%) create mode 100644 .solcover/extensions.js create mode 100644 .solcover/reputation.js rename .solcover.js => .solcover/solcover.js (98%) rename .solcover.upgrade.js => .solcover/upgrade.js (87%) diff --git a/.solcover.extensions.js b/.solcover.extensions.js deleted file mode 100644 index 35f997a4ff..0000000000 --- a/.solcover.extensions.js +++ /dev/null @@ -1,5 +0,0 @@ -const config = require("./.solcover.js") - -config.istanbulFolder = "./coverage-extensions" - -module.exports = config \ No newline at end of file diff --git a/.solcover.reputation.js b/.solcover.reputation.js deleted file mode 100644 index 158f59bcd5..0000000000 --- a/.solcover.reputation.js +++ /dev/null @@ -1,5 +0,0 @@ -const config = require("./.solcover.js") - -config.istanbulFolder = "./coverage-reputation" - -module.exports = config \ No newline at end of file diff --git a/.solcover.chainid.js b/.solcover/chainid.js similarity index 81% rename from .solcover.chainid.js rename to .solcover/chainid.js index 9faaa4e163..415cbfef9b 100644 --- a/.solcover.chainid.js +++ b/.solcover/chainid.js @@ -1,7 +1,7 @@ -const config = require("./.solcover.js") +const config = require("./solcover.js") config.providerOptions.network_id = parseInt(process.env.CHAIN_ID, 10); config.providerOptions._chainId = parseInt(process.env.CHAIN_ID, 10); config.providerOptions._chainIdRpc = parseInt(process.env.CHAIN_ID, 10); config.istanbulFolder = `./coverage-chainid-${process.env.CHAIN_ID}` -module.exports = config \ No newline at end of file +module.exports = config diff --git a/.solcover.crosschain.js b/.solcover/crosschain.js similarity index 84% rename from .solcover.crosschain.js rename to .solcover/crosschain.js index 0fbeca72ee..64d60fd407 100644 --- a/.solcover.crosschain.js +++ b/.solcover/crosschain.js @@ -1,7 +1,6 @@ -const config = require("./.solcover.js") -const ethers = require("ethers"); +const config = require("./solcover.js") -const { FORKED_XDAI_CHAINID } = require("./helpers/constants"); +const { FORKED_XDAI_CHAINID } = require("./../helpers/constants"); config.istanbulFolder = `./coverage-cross-chain-${process.env.HARDHAT_FOREIGN === "true" ? "foreign" : "home"}` console.log(`Coverage folder: ${config.istanbulFolder}`) diff --git a/.solcover/extensions.js b/.solcover/extensions.js new file mode 100644 index 0000000000..3023341960 --- /dev/null +++ b/.solcover/extensions.js @@ -0,0 +1,5 @@ +const config = require("./solcover.js") + +config.istanbulFolder = "./coverage-extensions" + +module.exports = config diff --git a/.solcover/reputation.js b/.solcover/reputation.js new file mode 100644 index 0000000000..cb6e10fc74 --- /dev/null +++ b/.solcover/reputation.js @@ -0,0 +1,5 @@ +const config = require("./solcover.js") + +config.istanbulFolder = "./coverage-reputation" + +module.exports = config diff --git a/.solcover.js b/.solcover/solcover.js similarity index 98% rename from .solcover.js rename to .solcover/solcover.js index 112603ae7c..ced5468603 100644 --- a/.solcover.js +++ b/.solcover/solcover.js @@ -13,7 +13,7 @@ module.exports = { }, providerOptions: { network_id: 1999, - account_keys_path: "./ganache-accounts.json", + account_keys_path: "./../ganache-accounts.json", vmErrorsOnRPCResponse: false, total_accounts: 18, _chainId: 265669100, diff --git a/.solcover.upgrade.js b/.solcover/upgrade.js similarity index 87% rename from .solcover.upgrade.js rename to .solcover/upgrade.js index a13d501321..64ddb8a39d 100644 --- a/.solcover.upgrade.js +++ b/.solcover/upgrade.js @@ -1,5 +1,6 @@ +const config = require("./solcover.js") + const { execSync } = require("child_process"); -const config = require("./.solcover.js") function getFilesToSkip(){ const array = [ @@ -16,4 +17,4 @@ function getFilesToSkip(){ config.istanbulFolder = "./coverage-upgrade" config.skipFiles = getFilesToSkip(); -module.exports = config \ No newline at end of file +module.exports = config diff --git a/package.json b/package.json index 7e1aa34b98..bb6bae532e 100644 --- a/package.json +++ b/package.json @@ -48,17 +48,17 @@ "test:contracts:bridging:2": "CHAIN_ID_1=265669101 CHAIN_ID_2=265669100 pnpm run start:blockchain:client:both && HARDHAT_FOREIGN=true MINING_CHAIN_ID=265669100 CHAIN_ID=265669101 npx hardhat test ./test/cross-chain/* --network development", "test:contracts:chainid": "pnpm run start:blockchain:client && npx hardhat test ./test/misc/chainid.js", "test:contracts:e2e": "pnpm run start:blockchain:client && npx hardhat test test/misc/end-to-end.js --network development", - "test:contracts:coverage": "npx hardhat coverage --temp build-coverage --testfiles './test/contracts-network/*'", - "test:contracts:extensions:coverage": "npx hardhat compile && NODE_OPTIONS='--max-old-space-size=6144' npx hardhat coverage --solcoverjs ./.solcover.extensions.js --temp build-coverage --testfiles './test/extensions/*'", - "test:contracts:bridging:1:coverage": "CHAIN_ID=265669101 pnpm run start:blockchain:client:2 && HARDHAT_FOREIGN=false MINING_CHAIN_ID=265669100 npx hardhat --show-stack-traces coverage --solcoverjs ./.solcover.crosschain.js --temp build-coverage --testfiles './test/cross-chain/**/*'", - "test:contracts:bridging:2:coverage": "CHAIN_ID=265669100 pnpm run start:blockchain:client:2 && HARDHAT_FOREIGN=true MINING_CHAIN_ID=265669100 CHAIN_ID=265669101 npx hardhat coverage --solcoverjs ./.solcover.crosschain.js --temp build-coverage --testfiles './test/cross-chain/**/*'", - "test:contracts:chainid:coverage": "npx hardhat coverage --solcoverjs ./.solcover.chainid.js --temp build-coverage --testfiles './test/misc/chainid.js'", - "test:contracts:upgrade:coverage": "pnpm run generate:test:contracts && npx hardhat coverage --solcoverjs ./.solcover.upgrade.js --temp build-coverage --testfiles './test/upgrade/*'", + "test:contracts:coverage": "npx hardhat coverage --solcoverjs ./.solcover/solcover.js --temp build-coverage --testfiles './test/contracts-network/*'", + "test:contracts:extensions:coverage": "npx hardhat compile && NODE_OPTIONS='--max-old-space-size=6144' npx hardhat coverage --solcoverjs ./.solcover/extensions.js --temp build-coverage --testfiles './test/extensions/*'", + "test:contracts:bridging:1:coverage": "CHAIN_ID=265669101 pnpm run start:blockchain:client:2 && HARDHAT_FOREIGN=false MINING_CHAIN_ID=265669100 npx hardhat --show-stack-traces coverage --solcoverjs ./.solcover/crosschain.js --temp build-coverage --testfiles './test/cross-chain/**/*'", + "test:contracts:bridging:2:coverage": "CHAIN_ID=265669100 pnpm run start:blockchain:client:2 && HARDHAT_FOREIGN=true MINING_CHAIN_ID=265669100 CHAIN_ID=265669101 npx hardhat coverage --solcoverjs ./.solcover/crosschain.js --temp build-coverage --testfiles './test/cross-chain/**/*'", + "test:contracts:chainid:coverage": "npx hardhat coverage --solcoverjs ./.solcover/chainid.js --temp build-coverage --testfiles './test/misc/chainid.js'", + "test:contracts:upgrade:coverage": "pnpm run generate:test:contracts && npx hardhat coverage --solcoverjs ./.solcover/upgrade.js --temp build-coverage --testfiles './test/upgrade/*'", "test:reputation:1": "pnpm run start:blockchain:client && npx hardhat test ./test/reputation-system/*.js --network development", "test:reputation:2": "pnpm run start:blockchain:client && npx hardhat test ./test/reputation-system/reputation-mining-client/* --network development", "test:reputation:1:anotherChain": "CHAIN_ID=101010101 pnpm run start:blockchain:client && MINING_CHAIN_ID=101010101 CHAIN_ID=101010101 npx hardhat test ./test/reputation-system/*.js --network development", "test:reputation:2:anotherChain": "CHAIN_ID=101010101 pnpm run start:blockchain:client && MINING_CHAIN_ID=101010101 CHAIN_ID=101010101 npx hardhat test ./test/reputation-system/reputation-mining-client/* --network development", - "test:reputation:coverage": "npx hardhat coverage --solcoverjs ./.solcover.reputation.js --temp build-coverage --testfiles './test/reputation-system/**/*'", + "test:reputation:coverage": "npx hardhat coverage --solcoverjs ./.solcover/reputation.js --temp build-coverage --testfiles './test/reputation-system/**/*'", "test:security:slither": "slither . --solc-disable-warnings --exclude-low --exclude-informational --exclude-optimization --filter-paths 'lib|contracts/testHelpers|@openzeppelin'", "posttest:contracts": "pnpm run stop:blockchain:client", "posttest:contracts:extensions": "pnpm run stop:blockchain:client",