Add more tests

This commit is contained in:
Amir Bandeali
2019-09-13 15:29:07 -05:00
parent 057aee8ad2
commit 6fd55b2f49
3 changed files with 33 additions and 2 deletions

View File

@@ -586,6 +586,30 @@ blockchainTests.resets('AssetProxyOwner', env => {
const tx = assetProxyOwner.executeTransaction.awaitTransactionSuccessAsync(results.txId);
expect(tx).to.revertWith(RevertReason.TxAlreadyExecuted);
});
it('should revert if the only call is unsuccessful', async () => {
const alwaysRevertSelector = '0xF1F2F3F4';
const data = [alwaysRevertSelector];
const destinations = [receiver.address];
const tx = assetProxyOwnerWrapper.submitConfirmAndExecuteTransactionAsync(
data,
destinations,
signerAddresses,
DEFAULT_TIME_LOCK,
);
expect(tx).to.revertWith(RevertReason.FailedExecution);
});
it('should revert if the any call is unsuccessful', async () => {
const alwaysRevertSelector = '0xF1F2F3F4';
const data = [hexRandom(), alwaysRevertSelector];
const destinations = [receiver.address, receiver.address];
const tx = assetProxyOwnerWrapper.submitConfirmAndExecuteTransactionAsync(
data,
destinations,
signerAddresses,
DEFAULT_TIME_LOCK,
);
expect(tx).to.revertWith(RevertReason.FailedExecution);
});
it('should be able to call registerFunctionCall after the default timelock', async () => {
const reg = createFunctionRegistration(1, 1, 1);
const data = [