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:
@ -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 })
|
||||
|
||||
Reference in New Issue
Block a user