Skip to content

Commit

Permalink
meta-txs: use events helpers
Browse files Browse the repository at this point in the history
  • Loading branch information
facuspagnuolo committed May 10, 2019
1 parent 3c6a500 commit a576413
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions test/contracts/relayer/relayer.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
const { sha3, soliditySha3 } = require('web3-utils')
const { getEventArgument, getNewProxyAddress } = require('../../helpers/events')

const ACL = artifacts.require('ACL')
const Kernel = artifacts.require('Kernel')
const Relayer = artifacts.require('Relayer')
const DAOFactory = artifacts.require('DAOFactory')
const SampleApp = artifacts.require('RelayedAppMock')

const getEventArgument = (receipt, event, arg) => receipt.logs.filter(l => l.event === event)[0].args[arg]

contract('VolatileRelayedApp', ([_, root, sender, vault, offChainRelayerService]) => {
let daoFactory, dao, acl, app, relayer, relayedTx, nonce = 1
let kernelBase, aclBase, sampleAppBase, relayerBase
Expand Down Expand Up @@ -38,7 +37,7 @@ contract('VolatileRelayedApp', ([_, root, sender, vault, offChainRelayerService]

before('create relayer instance', async () => {
const receipt = await dao.newAppInstance('0x11111', relayerBase.address, '0x', false, { from: root })
relayer = Relayer.at(getEventArgument(receipt, 'NewAppProxy', 'proxy'))
relayer = Relayer.at(getNewProxyAddress(receipt))
await relayer.initialize()

const SEND_ETH_GAS = 31000 // 21k base tx cost + 10k limit on depositable proxies
Expand All @@ -49,7 +48,7 @@ contract('VolatileRelayedApp', ([_, root, sender, vault, offChainRelayerService]

beforeEach('create sample app instance', async () => {
const receipt = await dao.newAppInstance('0x22222', sampleAppBase.address, '0x', false, { from: root })
app = SampleApp.at(getEventArgument(receipt, 'NewAppProxy', 'proxy'))
app = SampleApp.at(getNewProxyAddress(receipt))
await app.initialize()

await acl.createPermission(sender, app.address, WRITING_ROLE, root, { from: root })
Expand Down

0 comments on commit a576413

Please sign in to comment.