Skip to content

Commit

Permalink
test: add test for getting address balance with min_satoshi param
Browse files Browse the repository at this point in the history
  • Loading branch information
ahonn committed Mar 4, 2024
1 parent 84b8c36 commit 63a051e
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions test/routes/bitcoind/address.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,33 @@ describe('/bitcoin/v1/address', () => {
address: 'tb1qlrg2mhyxrq7ns5rpa6qvrvttr9674n6z0trymp',
satoshi: 181652,
pending_satoshi: 0,
dust_satoshi: 0,
utxo_count: 2,
});

await fastify.close();
});

test('Get address balance with min_satoshi param', async () => {
const fastify = buildFastify();
await fastify.ready();

const response = await fastify.inject({
method: 'GET',
url: '/bitcoin/v1/address/tb1qlrg2mhyxrq7ns5rpa6qvrvttr9674n6z0trymp/balance?min_satoshi=10000',
headers: {
Authorization: `Bearer ${token}`,
Origin: 'https://test.com',
},
});
const data = response.json();

expect(response.statusCode).toBe(200);
expect(data).toStrictEqual({
address: 'tb1qlrg2mhyxrq7ns5rpa6qvrvttr9674n6z0trymp',
satoshi: 180652,
pending_satoshi: 0,
dust_satoshi: 1000,
utxo_count: 2,
});

Expand Down

0 comments on commit 63a051e

Please sign in to comment.