Skip to content

Commit

Permalink
Disputable: Add tests to check role constants (#605)
Browse files Browse the repository at this point in the history
* disputable: Add tests to check role constants

* Disputable: Polish roles tests

Co-authored-by: Facu Spagnuolo <[email protected]>
  • Loading branch information
ßingen and facuspagnuolo authored Aug 1, 2020
1 parent 7436b47 commit 84f1c0d
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions test/contracts/apps/disputable/disputable_app.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
const { sha3 } = require('web3-utils')
const { assertRevert } = require('../../../helpers/assertThrow')
const { getEventArgument } = require('../../../helpers/events')
const { getNewProxyAddress } = require('../../../helpers/events')
Expand Down Expand Up @@ -322,4 +323,14 @@ contract('DisputableApp', ([_, owner, agreement, anotherAgreement, someone]) =>
})
})
})

describe('roles', () => {
it('computes roles properly', async () => {
const EXPECTED_CHALLENGE_ROLE = sha3('CHALLENGE_ROLE')
assert.equal(await disputableBase.CHALLENGE_ROLE(), EXPECTED_CHALLENGE_ROLE, 'CHALLENGE_ROLE doesn’t match')

const EXPECTED_SET_AGREEMENT_ROLE = sha3('SET_AGREEMENT_ROLE')
assert.equal(await disputableBase.SET_AGREEMENT_ROLE(), EXPECTED_SET_AGREEMENT_ROLE, 'SET_AGREEMENT_ROLE doesn’t match')
})
})
})

0 comments on commit 84f1c0d

Please sign in to comment.