Skip to content

Commit 6f91169

Browse files
committed
fix: receipts get url
1 parent f3bc5d8 commit 6f91169

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

client/api/receipts.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,4 @@ def all(self, **kwargs):
66
return self.with_endpoint('api').request_get('receipts', kwargs)
77

88
def get(self, transaction_hash: str):
9-
return self.with_endpoint('api').request_get('receipts', {
10-
'txHash': transaction_hash,
11-
})
9+
return self.with_endpoint('api').request_get(f'receipts/{transaction_hash}')

tests/api/test_receipts.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,12 @@ def test_get_calls_correct_url():
3636
transaction_hash = '12345'
3737
responses.add(
3838
responses.GET,
39-
f'http://127.0.0.1:4002/api/receipts?txHash={transaction_hash}',
39+
f'http://127.0.0.1:4002/api/receipts/{transaction_hash}',
4040
json={'success': True},
4141
status=200
4242
)
4343

4444
client = ArkClient('http://127.0.0.1:4002/api')
4545
client.receipts.get(transaction_hash)
4646
assert len(responses.calls) == 1
47-
assert responses.calls[0].request.url.startswith('http://127.0.0.1:4002/api/receipts?')
48-
assert f'txHash={transaction_hash}' in responses.calls[0].request.url
47+
assert responses.calls[0].request.url == f'http://127.0.0.1:4002/api/receipts/{transaction_hash}'

0 commit comments

Comments
 (0)