Skip to content

Commit a458e33

Browse files
feat: update exchange response from price.price to exchange.price (#13)
1 parent 6043f78 commit a458e33

3 files changed

Lines changed: 5 additions & 5 deletions

File tree

src/handlers/exchange/price.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,5 @@ export const exchangePrice = async ({
2222
assertNonNullish(symbol, 'Ledger ID not supported');
2323

2424
const price = await exchange.fetchPrice({ symbol });
25-
return { price };
25+
return { exchange: price };
2626
};

test/handlers/exchange/price.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ describe('handlers > exchange > price', () => {
2626

2727
const result = await exchangePrice(context);
2828

29-
expect(result.price).toEqual(mockExchangeTickerPrice);
29+
expect(result.exchange).toEqual(mockExchangeTickerPrice);
3030
expect(exchange.fetchPrice).toHaveBeenCalledWith({ symbol: 'ICPUSDT' });
3131
});
3232

test/server.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -185,9 +185,9 @@ describe('server', () => {
185185
const data = await response.json();
186186

187187
expect(response.status).toBe(200);
188-
expect(data.price.symbol).toBe('ICPUSDT');
189-
expect(data.price.price).toBe('2.23800000');
190-
expect(data.price.fetchedAt).toBeString();
188+
expect(data.exchange.symbol).toBe('ICPUSDT');
189+
expect(data.exchange.price).toBe('2.23800000');
190+
expect(data.exchange.fetchedAt).toBeString();
191191
});
192192

193193
it('should return 500 for unsupported ledger ID', async () => {

0 commit comments

Comments
 (0)