Add backstop tests

This commit is contained in:
Amir Bandeali
2019-10-06 13:17:02 -07:00
parent a7ef54dbff
commit 9e41c648dc
10 changed files with 93 additions and 6 deletions

View File

@@ -336,6 +336,17 @@ blockchainTests.resets('ZrxVault unit tests', env => {
expect(tx).to.revertWith(expectedError);
expect(await zrxVault.isInCatastrophicFailure.callAsync()).to.be.false();
});
it('Catastrophic Failure Mode can only be turned on once', async () => {
const authorized = nonOwnerAddresses[0];
await zrxVault.addAuthorizedAddress.awaitTransactionSuccessAsync(authorized, { from: owner });
await zrxVault.enterCatastrophicFailure.awaitTransactionSuccessAsync({
from: authorized,
});
const expectedError = new StakingRevertErrors.OnlyCallableIfNotInCatastrophicFailureError();
return expect(zrxVault.enterCatastrophicFailure.awaitTransactionSuccessAsync()).to.revertWith(
expectedError,
);
});
});
describe('Affected functionality', () => {