Add tests for adding/removing an exchange called by owner
This commit is contained in:
parent
745da8e363
commit
aa198ad15f
@ -95,6 +95,14 @@ blockchainTests.resets('Exchange Unit Tests', env => {
|
|||||||
return expect(tx).to.revertWith(expectedError);
|
return expect(tx).to.revertWith(expectedError);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('should revert when adding an exchange if called by the (non-authorized) owner', async () => {
|
||||||
|
const expectedError = new AuthorizableRevertErrors.SenderNotAuthorizedError(owner);
|
||||||
|
const tx = exchangeManager.addExchangeAddress.awaitTransactionSuccessAsync(nonExchange, {
|
||||||
|
from: owner,
|
||||||
|
});
|
||||||
|
return expect(tx).to.revertWith(expectedError);
|
||||||
|
});
|
||||||
|
|
||||||
it('should successfully add an exchange if called by an authorized address', async () => {
|
it('should successfully add an exchange if called by an authorized address', async () => {
|
||||||
// Register a new exchange.
|
// Register a new exchange.
|
||||||
const receipt = await exchangeManager.addExchangeAddress.awaitTransactionSuccessAsync(nonExchange, {
|
const receipt = await exchangeManager.addExchangeAddress.awaitTransactionSuccessAsync(nonExchange, {
|
||||||
@ -128,6 +136,14 @@ blockchainTests.resets('Exchange Unit Tests', env => {
|
|||||||
return expect(tx).to.revertWith(expectedError);
|
return expect(tx).to.revertWith(expectedError);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('should revert when removing an exchange if called by the (non-authorized) owner', async () => {
|
||||||
|
const expectedError = new AuthorizableRevertErrors.SenderNotAuthorizedError(owner);
|
||||||
|
const tx = exchangeManager.removeExchangeAddress.awaitTransactionSuccessAsync(nonExchange, {
|
||||||
|
from: owner,
|
||||||
|
});
|
||||||
|
return expect(tx).to.revertWith(expectedError);
|
||||||
|
});
|
||||||
|
|
||||||
it('should successfully remove a registered exchange if called by an authorized address', async () => {
|
it('should successfully remove a registered exchange if called by an authorized address', async () => {
|
||||||
// Remove the registered exchange.
|
// Remove the registered exchange.
|
||||||
const receipt = await exchangeManager.removeExchangeAddress.awaitTransactionSuccessAsync(exchange, {
|
const receipt = await exchangeManager.removeExchangeAddress.awaitTransactionSuccessAsync(exchange, {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user