Skip to content

Commit

Permalink
Consolidate .solcover config files
Browse files Browse the repository at this point in the history
  • Loading branch information
kronosapiens committed Jun 18, 2024
1 parent a5c0967 commit 7f5cffd
Show file tree
Hide file tree
Showing 9 changed files with 25 additions and 25 deletions.
5 changes: 0 additions & 5 deletions .solcover.extensions.js

This file was deleted.

5 changes: 0 additions & 5 deletions .solcover.reputation.js

This file was deleted.

4 changes: 2 additions & 2 deletions .solcover.chainid.js → .solcover/chainid.js
Original file line number Diff line number Diff line change
@@ -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
module.exports = config
5 changes: 2 additions & 3 deletions .solcover.crosschain.js → .solcover/crosschain.js
Original file line number Diff line number Diff line change
@@ -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}`)
Expand Down
5 changes: 5 additions & 0 deletions .solcover/extensions.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
const config = require("./solcover.js")

config.istanbulFolder = "./coverage-extensions"

module.exports = config
5 changes: 5 additions & 0 deletions .solcover/reputation.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
const config = require("./solcover.js")

config.istanbulFolder = "./coverage-reputation"

module.exports = config
2 changes: 1 addition & 1 deletion .solcover.js → .solcover/solcover.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
5 changes: 3 additions & 2 deletions .solcover.upgrade.js → .solcover/upgrade.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const config = require("./solcover.js")

const { execSync } = require("child_process");
const config = require("./.solcover.js")

function getFilesToSkip(){
const array = [
Expand All @@ -16,4 +17,4 @@ function getFilesToSkip(){
config.istanbulFolder = "./coverage-upgrade"
config.skipFiles = getFilesToSkip();

module.exports = config
module.exports = config
14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 7f5cffd

Please sign in to comment.