diff options
author | Alex Browne <stephenalexbrowne@gmail.com> | 2018-05-23 03:47:37 +0800 |
---|---|---|
committer | Alex Browne <stephenalexbrowne@gmail.com> | 2018-06-07 03:39:42 +0800 |
commit | 1cc9d9c0713a56b59717498fcae6dc2720ca4fb0 (patch) | |
tree | eb20715294306fc61f77ecacaecc85c6d1144165 /packages/contracts/test/unlimited_allowance_token.ts | |
parent | 72fb8460e90237fb7879fc47e95d84b6aa54911b (diff) | |
download | dexon-sol-tools-1cc9d9c0713a56b59717498fcae6dc2720ca4fb0.tar.gz dexon-sol-tools-1cc9d9c0713a56b59717498fcae6dc2720ca4fb0.tar.zst dexon-sol-tools-1cc9d9c0713a56b59717498fcae6dc2720ca4fb0.zip |
Replace constant.REVERT test assertions with expectRevertOrAlwaysFailingTransaction
Diffstat (limited to 'packages/contracts/test/unlimited_allowance_token.ts')
-rw-r--r-- | packages/contracts/test/unlimited_allowance_token.ts | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/packages/contracts/test/unlimited_allowance_token.ts b/packages/contracts/test/unlimited_allowance_token.ts index b2acdebaa..baa616f59 100644 --- a/packages/contracts/test/unlimited_allowance_token.ts +++ b/packages/contracts/test/unlimited_allowance_token.ts @@ -7,6 +7,7 @@ import * as Web3 from 'web3'; import { DummyERC20TokenContract } from '../src/contract_wrappers/generated/dummy_e_r_c20_token'; import { artifacts } from '../src/utils/artifacts'; +import { expectRevertOrAlwaysFailingTransaction } from '../src/utils/assertions'; import { chaiSetup } from '../src/utils/chai_setup'; import { constants } from '../src/utils/constants'; import { provider, txDefaults, web3Wrapper } from '../src/utils/web3_wrapper'; @@ -93,11 +94,11 @@ describe('UnlimitedAllowanceToken', () => { await token.approve.sendTransactionAsync(spender, amountToTransfer, { from: owner }), constants.AWAIT_TRANSACTION_MINED_MS, ); - return expect( + return expectRevertOrAlwaysFailingTransaction( token.transferFrom.callAsync(owner, spender, amountToTransfer, { from: spender, }), - ).to.be.rejectedWith(constants.REVERT); + ); }); it('should throw if spender has insufficient allowance', async () => { @@ -108,11 +109,11 @@ describe('UnlimitedAllowanceToken', () => { const isSpenderAllowanceInsufficient = spenderAllowance.cmp(amountToTransfer) < 0; expect(isSpenderAllowanceInsufficient).to.be.true(); - return expect( + return expectRevertOrAlwaysFailingTransaction( token.transferFrom.callAsync(owner, spender, amountToTransfer, { from: spender, }), - ).to.be.rejectedWith(constants.REVERT); + ); }); it('should return true on a 0 value transfer', async () => { |