From 2759f3b36203ec36632763c98197d61cd6f1903b Mon Sep 17 00:00:00 2001 From: Facundo Spagnuolo Date: Thu, 16 May 2019 18:10:08 -0300 Subject: [PATCH] meta-txs: ignore relayer contracts for coverage measure --- .solcover.js | 8 +++++--- contracts/relayer/Relayer.sol | 2 -- test/contracts/relayer/relayer.js | 6 +++--- test/helpers/coverage.js | 5 ++++- 4 files changed, 12 insertions(+), 9 deletions(-) diff --git a/.solcover.js b/.solcover.js index 38a69357e..69ab1ebc7 100644 --- a/.solcover.js +++ b/.solcover.js @@ -2,9 +2,11 @@ const skipFiles = [ 'lib', 'test', 'acl/ACLSyntaxSugar.sol', - 'common/DepositableStorage.sol', // Used in tests that send ETH - 'common/SafeERC20.sol', // solidity-coverage fails on assembly if (https://github.com/sc-forks/solidity-coverage/issues/287) - 'common/UnstructuredStorage.sol' // Used in tests that send ETH + 'common/DepositableStorage.sol', // Used in tests that send ETH + 'common/SafeERC20.sol', // solidity-coverage fails on assembly if (https://github.com/sc-forks/solidity-coverage/issues/287) + 'common/UnstructuredStorage.sol', // Used in tests that send ETH + 'relayer/Relayer.sol', // solidity-coverage uses test-rpc which does not implement eth_signTypedData + 'relayer/RelayedAragonApp.sol' // solidity-coverage uses test-rpc which does not implement eth_signTypedData ] module.exports = { diff --git a/contracts/relayer/Relayer.sol b/contracts/relayer/Relayer.sol index 7f666f04e..81624b951 100644 --- a/contracts/relayer/Relayer.sol +++ b/contracts/relayer/Relayer.sol @@ -6,8 +6,6 @@ import "../lib/sig/ECDSA.sol"; import "../lib/misc/EIP712.sol"; import "../lib/math/SafeMath.sol"; import "../apps/AragonApp.sol"; -import "../common/IsContract.sol"; -import "../common/TimeHelpers.sol"; import "../common/MemoryHelpers.sol"; import "../common/DepositableStorage.sol"; diff --git a/test/contracts/relayer/relayer.js b/test/contracts/relayer/relayer.js index 7ed3b5858..c70869a9e 100644 --- a/test/contracts/relayer/relayer.js +++ b/test/contracts/relayer/relayer.js @@ -1,6 +1,6 @@ const signTypedData = require('../../../lib/signTypedData')(web3) -const { skipCoverage } = require('../../helpers/coverage') const { assertRevert } = require('../../helpers/assertThrow') +const { skipCoverage, skipCoverageContract } = require('../../helpers/coverage') const { getEventArgument, getNewProxyAddress } = require('../../helpers/events') const { assertEvent, assertAmountOfEvents } = require('../../helpers/assertEvent')(web3) @@ -14,7 +14,7 @@ const NOW = 1557945653 const ONE_MONTH = 60 * 60 * 24 * 30 const ZERO_ADDRESS = '0x0000000000000000000000000000000000000000' -contract('Relayer', ([_, root, member, someone, vault, offChainRelayerService]) => { +skipCoverageContract('Relayer', ([_, root, member, someone, vault, offChainRelayerService]) => { let daoFactory, dao, acl, app, relayer let kernelBase, aclBase, sampleAppBase, relayerBase let WRITING_ROLE, APP_MANAGER_ROLE, RELAYER_APP_ID @@ -609,7 +609,7 @@ contract('Relayer', ([_, root, member, someone, vault, offChainRelayerService]) await assertRevert(app.write(10, { from: someone }), 'APP_AUTH_FAILED') }) - context('when the service is not allowed', () => { + context('when the service is allowed', () => { const from = offChainRelayerService beforeEach('allow service', async () => await relayer.allowService(offChainRelayerService, { from: root })) diff --git a/test/helpers/coverage.js b/test/helpers/coverage.js index f5f313242..2930f435f 100644 --- a/test/helpers/coverage.js +++ b/test/helpers/coverage.js @@ -9,6 +9,9 @@ const skipCoverage = test => { } } +const skipCoverageContract = process.env.SOLIDITY_COVERAGE === 'true' ? contract.skip : contract + module.exports = { - skipCoverage + skipCoverage, + skipCoverageContract }