Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/handlers/exchange/price.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@ export const exchangePrice = async ({
assertNonNullish(symbol, 'Ledger ID not supported');

const price = await exchange.fetchPrice({ symbol });
return { price };
return { exchange: price };
};
2 changes: 1 addition & 1 deletion test/handlers/exchange/price.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ describe('handlers > exchange > price', () => {

const result = await exchangePrice(context);

expect(result.price).toEqual(mockExchangeTickerPrice);
expect(result.exchange).toEqual(mockExchangeTickerPrice);
expect(exchange.fetchPrice).toHaveBeenCalledWith({ symbol: 'ICPUSDT' });
});

Expand Down
6 changes: 3 additions & 3 deletions test/server.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -185,9 +185,9 @@ describe('server', () => {
const data = await response.json();

expect(response.status).toBe(200);
expect(data.price.symbol).toBe('ICPUSDT');
expect(data.price.price).toBe('2.23800000');
expect(data.price.fetchedAt).toBeString();
expect(data.exchange.symbol).toBe('ICPUSDT');
expect(data.exchange.price).toBe('2.23800000');
expect(data.exchange.fetchedAt).toBeString();
});

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