diff options
author | Brandon Millman <brandon.millman@gmail.com> | 2018-01-09 08:35:12 +0800 |
---|---|---|
committer | Brandon Millman <brandon.millman@gmail.com> | 2018-01-09 08:35:12 +0800 |
commit | 734cf5819aee5d46719d1ca387666bfda6e475bd (patch) | |
tree | 264785cb0666e011b49842b47ac4b2408dddaa28 /packages/connect/test/http_client_test.ts | |
parent | 9f3acf8e2888b6105062e47664ecd5adaaf3c889 (diff) | |
parent | 35e0b6143ab1405259471e1c9c698bfcd869df5a (diff) | |
download | dexon-0x-contracts-734cf5819aee5d46719d1ca387666bfda6e475bd.tar.gz dexon-0x-contracts-734cf5819aee5d46719d1ca387666bfda6e475bd.tar.zst dexon-0x-contracts-734cf5819aee5d46719d1ca387666bfda6e475bd.zip |
Merge branch 'development' into fix/mutatedInput
* development:
Changes to abi-gen after code review
Added constructor ABIs to abi-gen
Describe #295 in a CHANGELOG
Add #302 description to changelog
Fix formatting
Apply prettier config
Install prettier
Remove formatting esilnt rules
sendTransactionAsync should return txHash string
Added Event generation to abi-gen
Publish
Add dates to CHANGELOG entries
Update subproviders CHANGELOG
Support both personal_sign and eth_sign
Fix Ledger tests given change from `personal_sign` to `eth_sign`
Update subprovider to catch correct RPC method
Rename guide
Update contribution guide
Fix broken links in the abi-gen README
Fix typing generation for arrays in which types separated by |s
Diffstat (limited to 'packages/connect/test/http_client_test.ts')
-rw-r--r-- | packages/connect/test/http_client_test.ts | 32 |
1 files changed, 15 insertions, 17 deletions
diff --git a/packages/connect/test/http_client_test.ts b/packages/connect/test/http_client_test.ts index db7077531..b33b946c0 100644 --- a/packages/connect/test/http_client_test.ts +++ b/packages/connect/test/http_client_test.ts @@ -1,24 +1,21 @@ -import {BigNumber} from 'bignumber.js'; +import { BigNumber } from 'bignumber.js'; import * as chai from 'chai'; import * as chaiAsPromised from 'chai-as-promised'; import * as dirtyChai from 'dirty-chai'; import * as fetchMock from 'fetch-mock'; import 'mocha'; -import {HttpClient} from '../src/index'; +import { HttpClient } from '../src/index'; -import {feesResponse} from './fixtures/standard_relayer_api/fees'; +import { feesResponse } from './fixtures/standard_relayer_api/fees'; import * as feesResponseJSON from './fixtures/standard_relayer_api/fees.json'; -import { - orderResponse, -} from './fixtures/standard_relayer_api/order/0xabc67323774bdbd24d94f977fa9ac94a50f016026fd13f42990861238897721f'; -// tslint:disable-next-line:max-line-length +import { orderResponse } from './fixtures/standard_relayer_api/order/0xabc67323774bdbd24d94f977fa9ac94a50f016026fd13f42990861238897721f'; import * as orderResponseJSON from './fixtures/standard_relayer_api/order/0xabc67323774bdbd24d94f977fa9ac94a50f016026fd13f42990861238897721f.json'; -import {orderbookResponse} from './fixtures/standard_relayer_api/orderbook'; +import { orderbookResponse } from './fixtures/standard_relayer_api/orderbook'; import * as orderbookJSON from './fixtures/standard_relayer_api/orderbook.json'; -import {ordersResponse} from './fixtures/standard_relayer_api/orders'; +import { ordersResponse } from './fixtures/standard_relayer_api/orders'; import * as ordersResponseJSON from './fixtures/standard_relayer_api/orders.json'; -import {tokenPairsResponse} from './fixtures/standard_relayer_api/token_pairs'; +import { tokenPairsResponse } from './fixtures/standard_relayer_api/token_pairs'; import * as tokenPairsResponseJSON from './fixtures/standard_relayer_api/token_pairs.json'; chai.config.includeStack = true; @@ -50,7 +47,7 @@ describe('HttpClient', () => { expect(tokenPairs).to.be.deep.equal(tokenPairsResponse); }); it('throws an error for invalid JSON response', async () => { - fetchMock.get(url, {test: 'dummy'}); + fetchMock.get(url, { test: 'dummy' }); expect(relayerClient.getTokenPairsAsync()).to.be.rejected(); }); }); @@ -72,7 +69,7 @@ describe('HttpClient', () => { expect(orders).to.be.deep.equal(ordersResponse); }); it('throws an error for invalid JSON response', async () => { - fetchMock.get(url, {test: 'dummy'}); + fetchMock.get(url, { test: 'dummy' }); expect(relayerClient.getOrdersAsync()).to.be.rejected(); }); }); @@ -85,7 +82,7 @@ describe('HttpClient', () => { expect(order).to.be.deep.equal(orderResponse); }); it('throws an error for invalid JSON response', async () => { - fetchMock.get(url, {test: 'dummy'}); + fetchMock.get(url, { test: 'dummy' }); expect(relayerClient.getOrderAsync(orderHash)).to.be.rejected(); }); }); @@ -94,15 +91,16 @@ describe('HttpClient', () => { baseTokenAddress: '0x323b5d4c32345ced77393b3530b1eed0f346429d', quoteTokenAddress: '0xa2b31dacf30a9c50ca473337c01d8a201ae33e32', }; - // tslint:disable-next-line:max-line-length - const url = `${relayUrl}/v0/orderbook?baseTokenAddress=${request.baseTokenAddress}"eTokenAddress=${request.quoteTokenAddress}`; + const url = `${relayUrl}/v0/orderbook?baseTokenAddress=${request.baseTokenAddress}"eTokenAddress=${ + request.quoteTokenAddress + }`; it('gets order book', async () => { fetchMock.get(url, orderbookJSON); const orderbook = await relayerClient.getOrderbookAsync(request); expect(orderbook).to.be.deep.equal(orderbookResponse); }); it('throws an error for invalid JSON response', async () => { - fetchMock.get(url, {test: 'dummy'}); + fetchMock.get(url, { test: 'dummy' }); expect(relayerClient.getOrderbookAsync(request)).to.be.rejected(); }); }); @@ -137,7 +135,7 @@ describe('HttpClient', () => { expect(expirationUnixTimestampSecBefore).to.be.deep.equal(request.expirationUnixTimestampSec); }); it('throws an error for invalid JSON response', async () => { - fetchMock.post(url, {test: 'dummy'}); + fetchMock.post(url, { test: 'dummy' }); expect(relayerClient.getFeesAsync(request)).to.be.rejected(); }); }); |