Improve encapsulation on SignatureBouncer, Whitelist and RBAC example (#1265)
* Improve encapsulation on Whitelist * remove only * update whitelisted crowdsale test * Improve encapsulation on SignatureBouncer * fix missing test * Improve encapsulation on RBAC example * Improve encapsulation on RBAC example * Remove extra visibility * Improve encapsulation on ERC20 Mintable * Improve encapsulation on Superuser * fix lint * add missing constant
This commit is contained in:
committed by
Francisco Giordano
parent
b0f20d43df
commit
f4eb51a7e9
@ -1,15 +1,13 @@
|
||||
const { expectThrow } = require('../../helpers/expectThrow');
|
||||
|
||||
const ROLE_MINTER = 'minter';
|
||||
|
||||
function shouldBehaveLikeRBACMintableToken (owner, [anyone]) {
|
||||
describe('handle roles', function () {
|
||||
it('owner can add and remove a minter role', async function () {
|
||||
await this.token.addMinter(anyone, { from: owner });
|
||||
(await this.token.hasRole(anyone, ROLE_MINTER)).should.equal(true);
|
||||
(await this.token.isMinter(anyone)).should.equal(true);
|
||||
|
||||
await this.token.removeMinter(anyone, { from: owner });
|
||||
(await this.token.hasRole(anyone, ROLE_MINTER)).should.equal(false);
|
||||
(await this.token.isMinter(anyone)).should.equal(false);
|
||||
});
|
||||
|
||||
it('anyone can\'t add or remove a minter role', async function () {
|
||||
|
||||
Reference in New Issue
Block a user