aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorLeonid Logvinov <logvinov.leon@gmail.com>2017-06-30 03:54:41 +0800
committerLeonid Logvinov <logvinov.leon@gmail.com>2017-06-30 03:54:41 +0800
commitfa3963199eb875fdd6a70235cee263c39c317baa (patch)
tree872d6129e6d9c1781d68ad18ebf5d5d0c3b3a3f0 /test
parente1e79519b9430427dd6cbe2bfa9ced246ff14fbc (diff)
downloaddexon-sol-tools-fa3963199eb875fdd6a70235cee263c39c317baa.tar
dexon-sol-tools-fa3963199eb875fdd6a70235cee263c39c317baa.tar.gz
dexon-sol-tools-fa3963199eb875fdd6a70235cee263c39c317baa.tar.bz2
dexon-sol-tools-fa3963199eb875fdd6a70235cee263c39c317baa.tar.lz
dexon-sol-tools-fa3963199eb875fdd6a70235cee263c39c317baa.tar.xz
dexon-sol-tools-fa3963199eb875fdd6a70235cee263c39c317baa.tar.zst
dexon-sol-tools-fa3963199eb875fdd6a70235cee263c39c317baa.zip
Make zeroEx.getOrderHashHex non-async
Diffstat (limited to 'test')
-rw-r--r--test/exchange_wrapper_test.ts18
-rw-r--r--test/utils/order_factory.ts2
2 files changed, 10 insertions, 10 deletions
diff --git a/test/exchange_wrapper_test.ts b/test/exchange_wrapper_test.ts
index 6c81bcb49..cf828bd8d 100644
--- a/test/exchange_wrapper_test.ts
+++ b/test/exchange_wrapper_test.ts
@@ -394,11 +394,11 @@ describe('ExchangeWrapper', () => {
signedOrder = await fillScenarios.createFillableSignedOrderAsync(
makerTokenAddress, takerTokenAddress, makerAddress, takerAddress, fillableAmount,
);
- signedOrderHashHex = await zeroEx.getOrderHashHexAsync(signedOrder);
+ signedOrderHashHex = zeroEx.getOrderHashHex(signedOrder);
anotherSignedOrder = await fillScenarios.createFillableSignedOrderAsync(
makerTokenAddress, takerTokenAddress, makerAddress, takerAddress, fillableAmount,
);
- anotherOrderHashHex = await zeroEx.getOrderHashHexAsync(anotherSignedOrder);
+ anotherOrderHashHex = zeroEx.getOrderHashHex(anotherSignedOrder);
orderFillBatch = [
{
signedOrder,
@@ -438,11 +438,11 @@ describe('ExchangeWrapper', () => {
signedOrder = await fillScenarios.createFillableSignedOrderAsync(
makerTokenAddress, takerTokenAddress, makerAddress, takerAddress, fillableAmount,
);
- signedOrderHashHex = await zeroEx.getOrderHashHexAsync(signedOrder);
+ signedOrderHashHex = zeroEx.getOrderHashHex(signedOrder);
anotherSignedOrder = await fillScenarios.createFillableSignedOrderAsync(
makerTokenAddress, takerTokenAddress, makerAddress, takerAddress, fillableAmount,
);
- anotherOrderHashHex = await zeroEx.getOrderHashHexAsync(anotherSignedOrder);
+ anotherOrderHashHex = zeroEx.getOrderHashHex(anotherSignedOrder);
signedOrders = [signedOrder, anotherSignedOrder];
});
describe('successful batch fills', () => {
@@ -490,7 +490,7 @@ describe('ExchangeWrapper', () => {
signedOrder = await fillScenarios.createFillableSignedOrderAsync(
makerTokenAddress, takerTokenAddress, makerAddress, takerAddress, fillableAmount,
);
- orderHashHex = await zeroEx.getOrderHashHexAsync(signedOrder);
+ orderHashHex = zeroEx.getOrderHashHex(signedOrder);
});
describe('#cancelOrderAsync', () => {
describe('failed cancels', () => {
@@ -505,7 +505,7 @@ describe('ExchangeWrapper', () => {
makerTokenAddress, takerTokenAddress, makerAddress, takerAddress,
fillableAmount, expirationInPast,
);
- orderHashHex = await zeroEx.getOrderHashHexAsync(expiredSignedOrder);
+ orderHashHex = zeroEx.getOrderHashHex(expiredSignedOrder);
return expect(zeroEx.exchange.cancelOrderAsync(expiredSignedOrder, cancelAmount))
.to.be.rejectedWith(ExchangeContractErrs.ORDER_CANCEL_EXPIRED);
});
@@ -537,7 +537,7 @@ describe('ExchangeWrapper', () => {
anotherSignedOrder = await fillScenarios.createFillableSignedOrderAsync(
makerTokenAddress, takerTokenAddress, makerAddress, takerAddress, fillableAmount,
);
- anotherOrderHashHex = await zeroEx.getOrderHashHexAsync(anotherSignedOrder);
+ anotherOrderHashHex = zeroEx.getOrderHashHex(anotherSignedOrder);
cancelBatch = [
{
order: signedOrder,
@@ -598,7 +598,7 @@ describe('ExchangeWrapper', () => {
signedOrder = await fillScenarios.createPartiallyFilledSignedOrderAsync(
makerTokenAddress, takerTokenAddress, takerAddress, fillableAmount, partialFillAmount,
);
- orderHash = await zeroEx.getOrderHashHexAsync(signedOrder);
+ orderHash = zeroEx.getOrderHashHex(signedOrder);
});
describe('#getUnavailableTakerAmountAsync', () => {
it ('should throw if passed an invalid orderHash', async () => {
@@ -805,7 +805,7 @@ describe('ExchangeWrapper', () => {
const signedOrder = await fillScenarios.createFillableSignedOrderAsync(
makerTokenAddress, takerTokenAddress, makerAddress, takerAddress, fillableAmount,
);
- const orderHash = await zeroEx.getOrderHashHexAsync(signedOrder);
+ const orderHash = zeroEx.getOrderHashHex(signedOrder);
const orderHashFromContract = await (zeroEx.exchange as any)
._getOrderHashHexUsingContractCallAsync(signedOrder);
expect(orderHash).to.equal(orderHashFromContract);
diff --git a/test/utils/order_factory.ts b/test/utils/order_factory.ts
index 0ac430dfe..22bf44c0f 100644
--- a/test/utils/order_factory.ts
+++ b/test/utils/order_factory.ts
@@ -34,7 +34,7 @@ export const orderFactory = {
feeRecipient,
expirationUnixTimestampSec,
};
- const orderHash = await zeroEx.getOrderHashHexAsync(order);
+ const orderHash = zeroEx.getOrderHashHex(order);
const ecSignature = await zeroEx.signOrderHashAsync(orderHash, maker);
const signedOrder: SignedOrder = _.assign(order, {ecSignature});
return signedOrder;