aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorLeonid <logvinov.leon@gmail.com>2017-06-10 01:41:55 +0800
committerGitHub <noreply@github.com>2017-06-10 01:41:55 +0800
commitb6abfe49904f3aa3c8ec88ab7a00ec4fded9754a (patch)
tree82f78a66b05b4138ac4d56800b2f37841980d127 /test
parent604ed46c140c67abde7735b808b79b8d26868d0b (diff)
parentd36930a04dd22bc17758b369241a5602bf1f6936 (diff)
downloaddexon-sol-tools-b6abfe49904f3aa3c8ec88ab7a00ec4fded9754a.tar
dexon-sol-tools-b6abfe49904f3aa3c8ec88ab7a00ec4fded9754a.tar.gz
dexon-sol-tools-b6abfe49904f3aa3c8ec88ab7a00ec4fded9754a.tar.bz2
dexon-sol-tools-b6abfe49904f3aa3c8ec88ab7a00ec4fded9754a.tar.lz
dexon-sol-tools-b6abfe49904f3aa3c8ec88ab7a00ec4fded9754a.tar.xz
dexon-sol-tools-b6abfe49904f3aa3c8ec88ab7a00ec4fded9754a.tar.zst
dexon-sol-tools-b6abfe49904f3aa3c8ec88ab7a00ec4fded9754a.zip
Merge branch 'master' into schema-tests
Diffstat (limited to 'test')
-rw-r--r--test/exchange_wrapper_test.ts11
1 files changed, 8 insertions, 3 deletions
diff --git a/test/exchange_wrapper_test.ts b/test/exchange_wrapper_test.ts
index f159de759..6a511e68d 100644
--- a/test/exchange_wrapper_test.ts
+++ b/test/exchange_wrapper_test.ts
@@ -531,6 +531,7 @@ describe('ExchangeWrapper', () => {
let fillableAmount: BigNumber.BigNumber;
let partialFillAmount: BigNumber.BigNumber;
let signedOrder: SignedOrder;
+ let orderHash: string;
before(() => {
takerAddress = userAddresses[1];
const [makerToken, takerToken] = tokens;
@@ -543,6 +544,7 @@ describe('ExchangeWrapper', () => {
signedOrder = await fillScenarios.createPartiallyFilledSignedOrderAsync(
makerTokenAddress, takerTokenAddress, takerAddress, fillableAmount, partialFillAmount,
);
+ orderHash = await zeroEx.getOrderHashHexAsync(signedOrder);
});
describe('#getUnavailableTakerAmountAsync', () => {
it ('should throw if passed an invalid orderHash', async () => {
@@ -554,7 +556,6 @@ describe('ExchangeWrapper', () => {
expect(unavailableValueT).to.be.bignumber.equal(0);
});
it ('should return the unavailableValueT for a valid and partially filled orderHash', async () => {
- const orderHash = await zeroEx.getOrderHashHexAsync(signedOrder);
const unavailableValueT = await zeroEx.exchange.getUnavailableTakerAmountAsync(orderHash);
expect(unavailableValueT).to.be.bignumber.equal(partialFillAmount);
});
@@ -569,7 +570,6 @@ describe('ExchangeWrapper', () => {
expect(filledValueT).to.be.bignumber.equal(0);
});
it ('should return the filledValueT for a valid and partially filled orderHash', async () => {
- const orderHash = await zeroEx.getOrderHashHexAsync(signedOrder);
const filledValueT = await zeroEx.exchange.getFilledTakerAmountAsync(orderHash);
expect(filledValueT).to.be.bignumber.equal(partialFillAmount);
});
@@ -584,10 +584,15 @@ describe('ExchangeWrapper', () => {
expect(cancelledValueT).to.be.bignumber.equal(0);
});
it ('should return the cancelledValueT for a valid and partially filled orderHash', async () => {
- const orderHash = await zeroEx.getOrderHashHexAsync(signedOrder);
const cancelledValueT = await zeroEx.exchange.getCanceledTakerAmountAsync(orderHash);
expect(cancelledValueT).to.be.bignumber.equal(0);
});
+ it ('should return the cancelledValueT for a valid and cancelled orderHash', async () => {
+ const cancelAmount = fillableAmount.minus(partialFillAmount);
+ await zeroEx.exchange.cancelOrderAsync(signedOrder, cancelAmount);
+ const cancelledValueT = await zeroEx.exchange.getCanceledTakerAmountAsync(orderHash);
+ expect(cancelledValueT).to.be.bignumber.equal(cancelAmount);
+ });
});
});
describe('#subscribeAsync', () => {