aboutsummaryrefslogtreecommitdiffstats
path: root/packages/contracts/test/ts/exchange
diff options
context:
space:
mode:
authorAmir Bandeali <abandeali1@gmail.com>2017-12-05 08:58:15 +0800
committerAmir Bandeali <abandeali1@gmail.com>2017-12-13 07:02:04 +0800
commite6862e973983d478b7683425983f18b4680dd238 (patch)
tree973e558090eb66357ea63e63d748732961499e0b /packages/contracts/test/ts/exchange
parent7008e882c0508939da117cd90fe06e7006b85300 (diff)
downloaddexon-sol-tools-e6862e973983d478b7683425983f18b4680dd238.tar
dexon-sol-tools-e6862e973983d478b7683425983f18b4680dd238.tar.gz
dexon-sol-tools-e6862e973983d478b7683425983f18b4680dd238.tar.bz2
dexon-sol-tools-e6862e973983d478b7683425983f18b4680dd238.tar.lz
dexon-sol-tools-e6862e973983d478b7683425983f18b4680dd238.tar.xz
dexon-sol-tools-e6862e973983d478b7683425983f18b4680dd238.tar.zst
dexon-sol-tools-e6862e973983d478b7683425983f18b4680dd238.zip
Fix errors with new testrpc version
Diffstat (limited to 'packages/contracts/test/ts/exchange')
-rw-r--r--packages/contracts/test/ts/exchange/core.ts26
-rw-r--r--packages/contracts/test/ts/exchange/wrapper.ts8
2 files changed, 17 insertions, 17 deletions
diff --git a/packages/contracts/test/ts/exchange/core.ts b/packages/contracts/test/ts/exchange/core.ts
index daf46ca37..e4aa74c32 100644
--- a/packages/contracts/test/ts/exchange/core.ts
+++ b/packages/contracts/test/ts/exchange/core.ts
@@ -422,7 +422,7 @@ contract('Exchange', (accounts: string[]) => {
takerTokenAmount: ZeroEx.toBaseUnitAmount(new BigNumber(200), 18),
});
- return expect(exWrapper.fillOrderAsync(order, taker)).to.be.rejectedWith(constants.INVALID_OPCODE);
+ return expect(exWrapper.fillOrderAsync(order, taker)).to.be.rejectedWith(constants.REVERT);
});
it('should throw if signature is invalid', async () => {
@@ -432,7 +432,7 @@ contract('Exchange', (accounts: string[]) => {
order.params.r = ethUtil.bufferToHex(ethUtil.sha3('invalidR'));
order.params.s = ethUtil.bufferToHex(ethUtil.sha3('invalidS'));
- return expect(exWrapper.fillOrderAsync(order, taker)).to.be.rejectedWith(constants.INVALID_OPCODE);
+ return expect(exWrapper.fillOrderAsync(order, taker)).to.be.rejectedWith(constants.REVERT);
});
it('should throw if makerTokenAmount is 0', async () => {
@@ -440,7 +440,7 @@ contract('Exchange', (accounts: string[]) => {
makerTokenAmount: new BigNumber(0),
});
- return expect(exWrapper.fillOrderAsync(order, taker)).to.be.rejectedWith(constants.INVALID_OPCODE);
+ return expect(exWrapper.fillOrderAsync(order, taker)).to.be.rejectedWith(constants.REVERT);
});
it('should throw if takerTokenAmount is 0', async () => {
@@ -448,14 +448,14 @@ contract('Exchange', (accounts: string[]) => {
takerTokenAmount: new BigNumber(0),
});
- return expect(exWrapper.fillOrderAsync(order, taker)).to.be.rejectedWith(constants.INVALID_OPCODE);
+ return expect(exWrapper.fillOrderAsync(order, taker)).to.be.rejectedWith(constants.REVERT);
});
it('should throw if fillTakerTokenAmount is 0', async () => {
order = await orderFactory.newSignedOrderAsync();
return expect(exWrapper.fillOrderAsync(order, taker, {fillTakerTokenAmount: new BigNumber(0)}))
- .to.be.rejectedWith(constants.INVALID_OPCODE);
+ .to.be.rejectedWith(constants.REVERT);
});
it('should not change balances if maker balances are too low to fill order and \
@@ -478,7 +478,7 @@ contract('Exchange', (accounts: string[]) => {
});
return expect(exWrapper.fillOrderAsync(order, taker, {shouldThrowOnInsufficientBalanceOrAllowance: true}))
- .to.be.rejectedWith(constants.INVALID_OPCODE);
+ .to.be.rejectedWith(constants.REVERT);
});
it('should not change balances if taker balances are too low to fill order and \
@@ -501,7 +501,7 @@ contract('Exchange', (accounts: string[]) => {
});
return expect(exWrapper.fillOrderAsync(order, taker, {shouldThrowOnInsufficientBalanceOrAllowance: true}))
- .to.be.rejectedWith(constants.INVALID_OPCODE);
+ .to.be.rejectedWith(constants.REVERT);
});
it('should not change balances if maker allowances are too low to fill order and \
@@ -520,7 +520,7 @@ contract('Exchange', (accounts: string[]) => {
async () => {
await rep.approve(TokenTransferProxy.address, 0, {from: maker});
expect(exWrapper.fillOrderAsync(order, taker, {shouldThrowOnInsufficientBalanceOrAllowance: true}))
- .to.be.rejectedWith(constants.INVALID_OPCODE);
+ .to.be.rejectedWith(constants.REVERT);
await rep.approve(TokenTransferProxy.address, INITIAL_ALLOWANCE, {from: maker});
});
@@ -540,7 +540,7 @@ contract('Exchange', (accounts: string[]) => {
async () => {
await dgd.approve(TokenTransferProxy.address, 0, {from: taker});
expect(exWrapper.fillOrderAsync(order, taker, {shouldThrowOnInsufficientBalanceOrAllowance: true}))
- .to.be.rejectedWith(constants.INVALID_OPCODE);
+ .to.be.rejectedWith(constants.REVERT);
await dgd.approve(TokenTransferProxy.address, INITIAL_ALLOWANCE, {from: taker});
});
@@ -651,7 +651,7 @@ contract('Exchange', (accounts: string[]) => {
});
it('should throw if not sent by maker', async () => {
- return expect(exWrapper.cancelOrderAsync(order, taker)).to.be.rejectedWith(constants.INVALID_OPCODE);
+ return expect(exWrapper.cancelOrderAsync(order, taker)).to.be.rejectedWith(constants.REVERT);
});
it('should throw if makerTokenAmount is 0', async () => {
@@ -659,7 +659,7 @@ contract('Exchange', (accounts: string[]) => {
makerTokenAmount: new BigNumber(0),
});
- return expect(exWrapper.cancelOrderAsync(order, maker)).to.be.rejectedWith(constants.INVALID_OPCODE);
+ return expect(exWrapper.cancelOrderAsync(order, maker)).to.be.rejectedWith(constants.REVERT);
});
it('should throw if takerTokenAmount is 0', async () => {
@@ -667,14 +667,14 @@ contract('Exchange', (accounts: string[]) => {
takerTokenAmount: new BigNumber(0),
});
- return expect(exWrapper.cancelOrderAsync(order, maker)).to.be.rejectedWith(constants.INVALID_OPCODE);
+ return expect(exWrapper.cancelOrderAsync(order, maker)).to.be.rejectedWith(constants.REVERT);
});
it('should throw if cancelTakerTokenAmount is 0', async () => {
order = await orderFactory.newSignedOrderAsync();
return expect(exWrapper.cancelOrderAsync(order, maker, {cancelTakerTokenAmount: new BigNumber(0)}))
- .to.be.rejectedWith(constants.INVALID_OPCODE);
+ .to.be.rejectedWith(constants.REVERT);
});
it('should be able to cancel a full order', async () => {
diff --git a/packages/contracts/test/ts/exchange/wrapper.ts b/packages/contracts/test/ts/exchange/wrapper.ts
index c40d60104..3097f6887 100644
--- a/packages/contracts/test/ts/exchange/wrapper.ts
+++ b/packages/contracts/test/ts/exchange/wrapper.ts
@@ -133,7 +133,7 @@ contract('Exchange', (accounts: string[]) => {
});
return expect(exWrapper.fillOrKillOrderAsync(order, taker))
- .to.be.rejectedWith(constants.INVALID_OPCODE);
+ .to.be.rejectedWith(constants.REVERT);
});
it('should throw if entire fillTakerTokenAmount not filled', async () => {
@@ -143,7 +143,7 @@ contract('Exchange', (accounts: string[]) => {
await exWrapper.fillOrderAsync(order, from, {fillTakerTokenAmount: order.params.takerTokenAmount.div(2)});
return expect(exWrapper.fillOrKillOrderAsync(order, taker))
- .to.be.rejectedWith(constants.INVALID_OPCODE);
+ .to.be.rejectedWith(constants.REVERT);
});
});
@@ -237,7 +237,7 @@ contract('Exchange', (accounts: string[]) => {
await exWrapper.fillOrKillOrderAsync(orders[0], taker);
return expect(exWrapper.batchFillOrKillOrdersAsync(orders, taker, {fillTakerTokenAmounts}))
- .to.be.rejectedWith(constants.INVALID_OPCODE);
+ .to.be.rejectedWith(constants.REVERT);
});
});
@@ -302,7 +302,7 @@ contract('Exchange', (accounts: string[]) => {
return expect(
exWrapper.fillOrdersUpToAsync(
orders, taker, {fillTakerTokenAmount: ZeroEx.toBaseUnitAmount(new BigNumber(1000), 18)}),
- ).to.be.rejectedWith(constants.INVALID_OPCODE);
+ ).to.be.rejectedWith(constants.REVERT);
});
});