From 6f91169cc1a9a88ce26b56e7cf62357136fd0105 Mon Sep 17 00:00:00 2001 From: Alex Barnsley <8069294+alexbarnsley@users.noreply.github.com> Date: Tue, 20 May 2025 16:03:40 +0100 Subject: [PATCH] fix: receipts get url --- client/api/receipts.py | 4 +--- tests/api/test_receipts.py | 5 ++--- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/client/api/receipts.py b/client/api/receipts.py index 64299be..7632832 100644 --- a/client/api/receipts.py +++ b/client/api/receipts.py @@ -6,6 +6,4 @@ def all(self, **kwargs): return self.with_endpoint('api').request_get('receipts', kwargs) def get(self, transaction_hash: str): - return self.with_endpoint('api').request_get('receipts', { - 'txHash': transaction_hash, - }) + return self.with_endpoint('api').request_get(f'receipts/{transaction_hash}') diff --git a/tests/api/test_receipts.py b/tests/api/test_receipts.py index bcd88b4..bebc330 100644 --- a/tests/api/test_receipts.py +++ b/tests/api/test_receipts.py @@ -36,7 +36,7 @@ def test_get_calls_correct_url(): transaction_hash = '12345' responses.add( responses.GET, - f'http://127.0.0.1:4002/api/receipts?txHash={transaction_hash}', + f'http://127.0.0.1:4002/api/receipts/{transaction_hash}', json={'success': True}, status=200 ) @@ -44,5 +44,4 @@ def test_get_calls_correct_url(): client = ArkClient('http://127.0.0.1:4002/api') client.receipts.get(transaction_hash) assert len(responses.calls) == 1 - assert responses.calls[0].request.url.startswith('http://127.0.0.1:4002/api/receipts?') - assert f'txHash={transaction_hash}' in responses.calls[0].request.url + assert responses.calls[0].request.url == f'http://127.0.0.1:4002/api/receipts/{transaction_hash}'