Skip to content

Commit

Permalink
meta-txs: ignore relayer service tests for coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
facuspagnuolo committed May 17, 2019
1 parent 9a64623 commit e2c41d2
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions test/lib/relayer/RelayerService.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
const { skipCoverage } = require('../../helpers/coverage')
const { getEventArgument, getNewProxyAddress } = require('../../helpers/events')

const RelayerService = require('../../../lib/relayer/RelayerService')(web3)
Expand Down Expand Up @@ -91,43 +92,43 @@ contract('RelayerService', ([_, root, member, someone, vault, offChainRelayerSer

context('when the relayed call does not revert', () => {
context('when the given gas amount does cover the transaction cost', () => {
it('relays transactions to app', async () => {
it('relays transactions to app', skipCoverage(async () => {
const transaction = await signer.signTransaction({ from: member, to: app.address, data })
await service.relay(transaction)

assert.equal((await app.read()).toString(), 10, 'app value does not match')
})
}))
})

context('when the given gas amount does not cover the transaction cost', () => {
const gasRefund = 5000

it('relays transactions to app', async () => {
it('relays transactions to app', skipCoverage(async () => {
const transaction = await signer.signTransaction({ from: member, to: app.address, data, gasRefund })

await assertRejects(service.relay(transaction), /Given gas refund amount \d* does not cover transaction gas cost \d*/)
})
}))
})
})

context('when the relayed call reverts', () => {
context('when the given gas amount does cover the transaction cost', () => {
it('throws an error', async () => {
it('throws an error', skipCoverage(async () => {
const transaction = await signer.signTransaction({ from: member, to: app.address, data })
transaction.from = someone

await assertRejects(service.relay(transaction), /Will not relay failing transaction.*RELAYER_SENDER_NOT_ALLOWED/)
})
}))
})

context('when the given gas amount does not cover the transaction cost', () => {
const gasRefund = 5000

it('throws an error', async () => {
it('throws an error', skipCoverage(async () => {
const transaction = await signer.signTransaction({ from: someone, to: app.address, data, gasRefund })

await assertRejects(service.relay(transaction), /Will not relay failing transaction.*RELAYER_SENDER_NOT_ALLOWED/)
})
}))
})
})
})
Expand Down

0 comments on commit e2c41d2

Please sign in to comment.