* 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
29 lines
881 B
JavaScript
29 lines
881 B
JavaScript
const { expectThrow } = require('../../helpers/expectThrow');
|
|
|
|
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.isMinter(anyone)).should.equal(true);
|
|
|
|
await this.token.removeMinter(anyone, { from: owner });
|
|
(await this.token.isMinter(anyone)).should.equal(false);
|
|
});
|
|
|
|
it('anyone can\'t add or remove a minter role', async function () {
|
|
await expectThrow(
|
|
this.token.addMinter(anyone, { from: anyone })
|
|
);
|
|
|
|
await this.token.addMinter(anyone, { from: owner });
|
|
await expectThrow(
|
|
this.token.removeMinter(anyone, { from: anyone })
|
|
);
|
|
});
|
|
});
|
|
}
|
|
|
|
module.exports = {
|
|
shouldBehaveLikeRBACMintableToken,
|
|
};
|