Skip to content

Commit

Permalink
test: age sort
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaelcr committed Jan 8, 2024
1 parent 5d5ccb7 commit c086755
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/tests/mempool-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1114,6 +1114,23 @@ describe('mempool tests', () => {
expect(json.results[2].fee_rate).toBe('300');
expect(json.results[3].fee_rate).toBe('400');
expect(json.results[4].fee_rate).toBe('500');

// Newer transactions were set with higher fees.
result = await supertest(api.server).get(`/extended/v1/tx/mempool?order_by=age&order=desc`);
json = JSON.parse(result.text);
expect(json.results[0].fee_rate).toBe('500');
expect(json.results[1].fee_rate).toBe('400');
expect(json.results[2].fee_rate).toBe('300');
expect(json.results[3].fee_rate).toBe('200');
expect(json.results[4].fee_rate).toBe('100');

result = await supertest(api.server).get(`/extended/v1/tx/mempool?order_by=age&order=asc`);
json = JSON.parse(result.text);
expect(json.results[0].fee_rate).toBe('100');
expect(json.results[1].fee_rate).toBe('200');
expect(json.results[2].fee_rate).toBe('300');
expect(json.results[3].fee_rate).toBe('400');
expect(json.results[4].fee_rate).toBe('500');
});

test('mempool - contract_call tx abi details are retrieved', async () => {
Expand Down

0 comments on commit c086755

Please sign in to comment.