aboutsummaryrefslogtreecommitdiffstats
path: root/packages/contracts/test/ether_token.ts
diff options
context:
space:
mode:
authorFabio Berger <me@fabioberger.com>2018-06-07 18:27:03 +0800
committerFabio Berger <me@fabioberger.com>2018-06-07 18:27:03 +0800
commit73429fc7202ff7b58eb64a7e0b939b971f16a27e (patch)
tree6abd050f91750c819e98045d21cd8952a0e14071 /packages/contracts/test/ether_token.ts
parentcb754ee1253622974e751e4a8d723a424250c878 (diff)
parente0bc01eea1c20e0afda296f331c6a475e062b59c (diff)
downloaddexon-sol-tools-73429fc7202ff7b58eb64a7e0b939b971f16a27e.tar
dexon-sol-tools-73429fc7202ff7b58eb64a7e0b939b971f16a27e.tar.gz
dexon-sol-tools-73429fc7202ff7b58eb64a7e0b939b971f16a27e.tar.bz2
dexon-sol-tools-73429fc7202ff7b58eb64a7e0b939b971f16a27e.tar.lz
dexon-sol-tools-73429fc7202ff7b58eb64a7e0b939b971f16a27e.tar.xz
dexon-sol-tools-73429fc7202ff7b58eb64a7e0b939b971f16a27e.tar.zst
dexon-sol-tools-73429fc7202ff7b58eb64a7e0b939b971f16a27e.zip
merge v2-prototype
Diffstat (limited to 'packages/contracts/test/ether_token.ts')
-rw-r--r--packages/contracts/test/ether_token.ts13
1 files changed, 6 insertions, 7 deletions
diff --git a/packages/contracts/test/ether_token.ts b/packages/contracts/test/ether_token.ts
index 000ea6e46..e2fc69aee 100644
--- a/packages/contracts/test/ether_token.ts
+++ b/packages/contracts/test/ether_token.ts
@@ -1,11 +1,12 @@
-import { BlockchainLifecycle, devConstants, web3Factory } from '@0xproject/dev-utils';
-import { BigNumber, promisify } from '@0xproject/utils';
+import { BlockchainLifecycle } from '@0xproject/dev-utils';
+import { BigNumber } from '@0xproject/utils';
import { Web3Wrapper } from '@0xproject/web3-wrapper';
import * as chai from 'chai';
import 'make-promises-safe';
import { WETH9Contract } from '../src/generated_contract_wrappers/weth9';
import { artifacts } from '../src/utils/artifacts';
+import { expectInsufficientFundsAsync, expectRevertOrAlwaysFailingTransactionAsync } 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';
@@ -45,9 +46,7 @@ describe('EtherToken', () => {
const initEthBalance = await web3Wrapper.getBalanceInWeiAsync(account);
const ethToDeposit = initEthBalance.plus(1);
- return expect(etherToken.deposit.sendTransactionAsync({ value: ethToDeposit })).to.be.rejectedWith(
- "ender doesn't have enough funds to send tx.",
- );
+ return expectInsufficientFundsAsync(etherToken.deposit.sendTransactionAsync({ value: ethToDeposit }));
});
it('should convert deposited Ether to wrapped Ether tokens', async () => {
@@ -76,8 +75,8 @@ describe('EtherToken', () => {
const initEthTokenBalance = await etherToken.balanceOf.callAsync(account);
const ethTokensToWithdraw = initEthTokenBalance.plus(1);
- return expect(etherToken.withdraw.sendTransactionAsync(ethTokensToWithdraw)).to.be.rejectedWith(
- constants.REVERT,
+ return expectRevertOrAlwaysFailingTransactionAsync(
+ etherToken.withdraw.sendTransactionAsync(ethTokensToWithdraw),
);
});