diff options
author | Leonid Logvinov <logvinov.leon@gmail.com> | 2017-07-12 07:23:19 +0800 |
---|---|---|
committer | Leonid Logvinov <logvinov.leon@gmail.com> | 2017-07-12 08:45:35 +0800 |
commit | fbf89aea1c710f4af131fa8d5653e0f1914ff88a (patch) | |
tree | 639849b7dcf7e02e8b4698f09e6d99c0b71e619d /test | |
parent | 98e8a6dd706f0a630402d9009ad3dcf9b0ff872d (diff) | |
download | dexon-0x-contracts-fbf89aea1c710f4af131fa8d5653e0f1914ff88a.tar.gz dexon-0x-contracts-fbf89aea1c710f4af131fa8d5653e0f1914ff88a.tar.zst dexon-0x-contracts-fbf89aea1c710f4af131fa8d5653e0f1914ff88a.zip |
Make getOrderHashHex static
Diffstat (limited to 'test')
-rw-r--r-- | test/0x.js_test.ts | 2 | ||||
-rw-r--r-- | test/exchange_wrapper_test.ts | 18 | ||||
-rw-r--r-- | test/utils/order_factory.ts | 2 |
3 files changed, 11 insertions, 11 deletions
diff --git a/test/0x.js_test.ts b/test/0x.js_test.ts index c6ede843f..3d9aa105b 100644 --- a/test/0x.js_test.ts +++ b/test/0x.js_test.ts @@ -142,7 +142,7 @@ describe('ZeroEx library', () => { expirationUnixTimestampSec: new BigNumber(0), }; it('calculates the order hash', async () => { - const orderHash = zeroEx.getOrderHashHex(order); + const orderHash = ZeroEx.getOrderHashHex(order); expect(orderHash).to.be.equal(expectedOrderHash); }); }); diff --git a/test/exchange_wrapper_test.ts b/test/exchange_wrapper_test.ts index d8af9d1cd..eb07b09ba 100644 --- a/test/exchange_wrapper_test.ts +++ b/test/exchange_wrapper_test.ts @@ -396,11 +396,11 @@ describe('ExchangeWrapper', () => { signedOrder = await fillScenarios.createFillableSignedOrderAsync( makerTokenAddress, takerTokenAddress, makerAddress, takerAddress, fillableAmount, ); - signedOrderHashHex = zeroEx.getOrderHashHex(signedOrder); + signedOrderHashHex = ZeroEx.getOrderHashHex(signedOrder); anotherSignedOrder = await fillScenarios.createFillableSignedOrderAsync( makerTokenAddress, takerTokenAddress, makerAddress, takerAddress, fillableAmount, ); - anotherOrderHashHex = zeroEx.getOrderHashHex(anotherSignedOrder); + anotherOrderHashHex = ZeroEx.getOrderHashHex(anotherSignedOrder); orderFillBatch = [ { signedOrder, @@ -436,11 +436,11 @@ describe('ExchangeWrapper', () => { signedOrder = await fillScenarios.createFillableSignedOrderAsync( makerTokenAddress, takerTokenAddress, makerAddress, takerAddress, fillableAmount, ); - signedOrderHashHex = zeroEx.getOrderHashHex(signedOrder); + signedOrderHashHex = ZeroEx.getOrderHashHex(signedOrder); anotherSignedOrder = await fillScenarios.createFillableSignedOrderAsync( makerTokenAddress, takerTokenAddress, makerAddress, takerAddress, fillableAmount, ); - anotherOrderHashHex = zeroEx.getOrderHashHex(anotherSignedOrder); + anotherOrderHashHex = ZeroEx.getOrderHashHex(anotherSignedOrder); signedOrders = [signedOrder, anotherSignedOrder]; }); describe('successful batch fills', () => { @@ -484,7 +484,7 @@ describe('ExchangeWrapper', () => { signedOrder = await fillScenarios.createFillableSignedOrderAsync( makerTokenAddress, takerTokenAddress, makerAddress, takerAddress, fillableAmount, ); - orderHashHex = zeroEx.getOrderHashHex(signedOrder); + orderHashHex = ZeroEx.getOrderHashHex(signedOrder); }); describe('#cancelOrderAsync', () => { describe('failed cancels', () => { @@ -499,7 +499,7 @@ describe('ExchangeWrapper', () => { makerTokenAddress, takerTokenAddress, makerAddress, takerAddress, fillableAmount, expirationInPast, ); - orderHashHex = zeroEx.getOrderHashHex(expiredSignedOrder); + orderHashHex = ZeroEx.getOrderHashHex(expiredSignedOrder); return expect(zeroEx.exchange.cancelOrderAsync(expiredSignedOrder, cancelAmount)) .to.be.rejectedWith(ExchangeContractErrs.ORDER_CANCEL_EXPIRED); }); @@ -529,7 +529,7 @@ describe('ExchangeWrapper', () => { anotherSignedOrder = await fillScenarios.createFillableSignedOrderAsync( makerTokenAddress, takerTokenAddress, makerAddress, takerAddress, fillableAmount, ); - anotherOrderHashHex = zeroEx.getOrderHashHex(anotherSignedOrder); + anotherOrderHashHex = ZeroEx.getOrderHashHex(anotherSignedOrder); cancelBatch = [ { order: signedOrder, @@ -588,7 +588,7 @@ describe('ExchangeWrapper', () => { signedOrder = await fillScenarios.createPartiallyFilledSignedOrderAsync( makerTokenAddress, takerTokenAddress, takerAddress, fillableAmount, partialFillAmount, ); - orderHash = zeroEx.getOrderHashHex(signedOrder); + orderHash = ZeroEx.getOrderHashHex(signedOrder); }); describe('#getUnavailableTakerAmountAsync', () => { it('should throw if passed an invalid orderHash', async () => { @@ -782,7 +782,7 @@ describe('ExchangeWrapper', () => { const signedOrder = await fillScenarios.createFillableSignedOrderAsync( makerTokenAddress, takerTokenAddress, makerAddress, takerAddress, fillableAmount, ); - const orderHash = zeroEx.getOrderHashHex(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 22bf44c0f..fc4adebd9 100644 --- a/test/utils/order_factory.ts +++ b/test/utils/order_factory.ts @@ -34,7 +34,7 @@ export const orderFactory = { feeRecipient, expirationUnixTimestampSec, }; - const orderHash = zeroEx.getOrderHashHex(order); + const orderHash = ZeroEx.getOrderHashHex(order); const ecSignature = await zeroEx.signOrderHashAsync(orderHash, maker); const signedOrder: SignedOrder = _.assign(order, {ecSignature}); return signedOrder; |