From 69eb820d0dbca63a6725d99d2d547506e60068ce Mon Sep 17 00:00:00 2001 From: fragosti Date: Tue, 4 Sep 2018 15:47:49 -0700 Subject: Change orderConfig from POST to GET like in spec --- packages/connect/src/http_client.ts | 2 +- packages/connect/test/http_client_test.ts | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'packages/connect') diff --git a/packages/connect/src/http_client.ts b/packages/connect/src/http_client.ts index b90c2c35f..87d5c30be 100644 --- a/packages/connect/src/http_client.ts +++ b/packages/connect/src/http_client.ts @@ -151,7 +151,7 @@ export class HttpClient implements Client { params: requestOpts, payload: request, }; - const responseJson = await this._requestAsync('/order_config', HttpRequestType.Post, httpRequestOpts); + const responseJson = await this._requestAsync('/order_config', HttpRequestType.Get, httpRequestOpts); const fees = relayerResponseJsonParsers.parseOrderConfigResponseJson(responseJson); return fees; } diff --git a/packages/connect/test/http_client_test.ts b/packages/connect/test/http_client_test.ts index e9fc9372e..83b77021a 100644 --- a/packages/connect/test/http_client_test.ts +++ b/packages/connect/test/http_client_test.ts @@ -148,12 +148,12 @@ describe('HttpClient', () => { }; const url = `${relayUrl}/order_config`; it('gets order config', async () => { - fetchMock.post(url, orderConfigResponseJSON); + fetchMock.get(url, orderConfigResponseJSON); const fees = await relayerClient.getOrderConfigAsync(request); expect(fees).to.be.deep.equal(orderConfigResponse); }); it('does not mutate input', async () => { - fetchMock.post(url, orderConfigResponseJSON); + fetchMock.get(url, orderConfigResponseJSON); const makerAssetAmountBefore = request.makerAssetAmount; const takerAssetAmountBefore = request.takerAssetAmount; const expirationTimeSecondsBefore = request.expirationTimeSeconds; @@ -163,7 +163,7 @@ describe('HttpClient', () => { expect(expirationTimeSecondsBefore).to.be.deep.equal(request.expirationTimeSeconds); }); it('throws an error for invalid JSON response', async () => { - fetchMock.post(url, { test: 'dummy' }); + fetchMock.get(url, { test: 'dummy' }); expect(relayerClient.getOrderConfigAsync(request)).to.be.rejected(); }); }); -- cgit v1.2.3