diff options
author | Alex Browne <stephenalexbrowne@gmail.com> | 2018-06-02 06:59:34 +0800 |
---|---|---|
committer | Alex Browne <stephenalexbrowne@gmail.com> | 2018-06-07 03:40:30 +0800 |
commit | 2dfc4680941293ca9f4a55f3ca58b9ee68872754 (patch) | |
tree | b4f06876bfa2e18c455bf13c24a62b3d8787741c /packages/contracts/test/ether_token.ts | |
parent | 98ffe9931d4fd8886955c45c42eb63b33184ddd2 (diff) | |
download | dexon-0x-contracts-2dfc4680941293ca9f4a55f3ca58b9ee68872754.tar.gz dexon-0x-contracts-2dfc4680941293ca9f4a55f3ca58b9ee68872754.tar.zst dexon-0x-contracts-2dfc4680941293ca9f4a55f3ca58b9ee68872754.zip |
Update more tests to pass on Geth
Diffstat (limited to 'packages/contracts/test/ether_token.ts')
-rw-r--r-- | packages/contracts/test/ether_token.ts | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/packages/contracts/test/ether_token.ts b/packages/contracts/test/ether_token.ts index f63d143a6..ee1a0a876 100644 --- a/packages/contracts/test/ether_token.ts +++ b/packages/contracts/test/ether_token.ts @@ -6,6 +6,7 @@ import 'make-promises-safe'; import { WETH9Contract } from '../src/contract_wrappers/generated/weth9'; import { artifacts } from '../src/utils/artifacts'; +import { expectInsufficientFunds, 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'; @@ -41,14 +42,11 @@ describe('EtherToken', () => { await blockchainLifecycle.revertAsync(); }); describe('deposit', () => { - // TODO(albrow): AssertionError: expected promise to be rejected with an error including 'ender doesn\'t have enough funds to send tx.' but got 'insufficient funds for gas * price + value' - it.skip('should throw if caller attempts to deposit more Ether than caller balance', async () => { + it('should throw if caller attempts to deposit more Ether than caller balance', async () => { 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 expectInsufficientFunds(etherToken.deposit.sendTransactionAsync({ value: ethToDeposit })); }); it('should convert deposited Ether to wrapped Ether tokens', async () => { @@ -73,13 +71,12 @@ describe('EtherToken', () => { }); describe('withdraw', () => { - // TODO(albrow): AssertionError: expected promise to be rejected with an error including 'revert' but got 'gas required exceeds allowance or always failing transaction' - it.skip('should throw if caller attempts to withdraw greater than caller balance', async () => { + it('should throw if caller attempts to withdraw greater than caller balance', async () => { const initEthTokenBalance = await etherToken.balanceOf.callAsync(account); const ethTokensToWithdraw = initEthTokenBalance.plus(1); - return expect(etherToken.withdraw.sendTransactionAsync(ethTokensToWithdraw)).to.be.rejectedWith( - constants.REVERT, + return expectRevertOrAlwaysFailingTransaction( + etherToken.withdraw.sendTransactionAsync(ethTokensToWithdraw), ); }); |