Skip to content

Commit

Permalink
meta-txs: ignore relayer contracts for coverage measure
Browse files Browse the repository at this point in the history
  • Loading branch information
facuspagnuolo committed May 16, 2019
1 parent f092d3b commit 2759f3b
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 9 deletions.
8 changes: 5 additions & 3 deletions .solcover.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
2 changes: 0 additions & 2 deletions contracts/relayer/Relayer.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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";

Expand Down
6 changes: 3 additions & 3 deletions test/contracts/relayer/relayer.js
Original file line number Diff line number Diff line change
@@ -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)

Expand All @@ -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
Expand Down Expand Up @@ -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 }))
Expand Down
5 changes: 4 additions & 1 deletion test/helpers/coverage.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ const skipCoverage = test => {
}
}

const skipCoverageContract = process.env.SOLIDITY_COVERAGE === 'true' ? contract.skip : contract

module.exports = {
skipCoverage
skipCoverage,
skipCoverageContract
}

0 comments on commit 2759f3b

Please sign in to comment.