feat: refactor whitelist.sol to use RBAC (#893)

* feat: refactor whitelist.sol to use RBAC

* fix: remove poor backwards compat attempt
This commit is contained in:
Matt Condon
2018-05-08 17:20:28 -07:00
committed by GitHub
parent f0eea31bdf
commit 4223c9d50e
2 changed files with 40 additions and 36 deletions

View File

@ -44,11 +44,6 @@ contract('Whitelist', function (accounts) {
}
});
it('should not announce WhitelistedAddressAdded event if address is already in the whitelist', async function () {
const { logs } = await mock.addAddressToWhitelist(whitelistedAddress1, { from: owner });
logs.should.be.empty;
});
it('should remove address from the whitelist', async function () {
await expectEvent.inTransaction(
mock.removeAddressFromWhitelist(whitelistedAddress1, { from: owner }),
@ -69,11 +64,6 @@ contract('Whitelist', function (accounts) {
}
});
it('should not announce WhitelistedAddressRemoved event if address is not in the whitelist', async function () {
const { logs } = await mock.removeAddressFromWhitelist(whitelistedAddress1, { from: owner });
logs.should.be.empty;
});
it('should allow whitelisted address to call #onlyWhitelistedCanDoThis', async () => {
await mock.addAddressToWhitelist(whitelistedAddress1, { from: owner });
await mock.onlyWhitelistedCanDoThis({ from: whitelistedAddress1 })
@ -87,13 +77,13 @@ contract('Whitelist', function (accounts) {
mock.addAddressToWhitelist(whitelistedAddress1, { from: anyone })
);
});
it('should not allow "anyone" to remove from the whitelist', async () => {
await expectThrow(
mock.removeAddressFromWhitelist(whitelistedAddress1, { from: anyone })
);
});
it('should not allow "anyone" to call #onlyWhitelistedCanDoThis', async () => {
await expectThrow(
mock.onlyWhitelistedCanDoThis({ from: anyone })