From 2821bce7e58bc64a30d321cfec12b81445afd7c3 Mon Sep 17 00:00:00 2001 From: Alex Barnsley <8069294+alexbarnsley@users.noreply.github.com> Date: Wed, 26 Mar 2025 17:24:05 +0000 Subject: [PATCH] refactor: rename wallets transaction methods --- client/api/wallets.py | 4 ++-- tests/api/test_wallets.py | 16 ++++++++-------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/client/api/wallets.py b/client/api/wallets.py index 6b6a38c..81ecf02 100644 --- a/client/api/wallets.py +++ b/client/api/wallets.py @@ -29,14 +29,14 @@ def transactions(self, wallet_id, page=None, limit=100, **kwargs): } return self.with_endpoint('api').request_get(f'wallets/{wallet_id}/transactions', params) - def transactions_sent(self, wallet_id, page=None, limit=100): + def sent_transactions(self, wallet_id, page=None, limit=100): params = { 'page': page, 'limit': limit, } return self.with_endpoint('api').request_get(f'wallets/{wallet_id}/transactions/sent', params) - def transactions_received(self, wallet_id, page=None, limit=100): + def received_transactions(self, wallet_id, page=None, limit=100): params = { 'page': page, 'limit': limit, diff --git a/tests/api/test_wallets.py b/tests/api/test_wallets.py index 6500355..ca164ec 100644 --- a/tests/api/test_wallets.py +++ b/tests/api/test_wallets.py @@ -134,7 +134,7 @@ def test_transactions_calls_correct_url_with_passed_in_params(): assert 'limit=69' in responses.calls[0].request.url -def test_transactions_sent_calls_correct_url_with_default_params(): +def test_sent_transactions_calls_correct_url_with_default_params(): wallet_id = '12345' responses.add( responses.GET, @@ -144,14 +144,14 @@ def test_transactions_sent_calls_correct_url_with_default_params(): ) client = ArkClient('http://127.0.0.1:4002/api') - client.wallets.transactions_sent(wallet_id) + client.wallets.sent_transactions(wallet_id) assert len(responses.calls) == 1 assert responses.calls[0].request.url == ( 'http://127.0.0.1:4002/api/wallets/12345/transactions/sent?limit=100' ) -def test_transactions_sent_calls_correct_url_with_passed_in_params(): +def test_sent_transactions_calls_correct_url_with_passed_in_params(): wallet_id = '12345' responses.add( responses.GET, @@ -161,7 +161,7 @@ def test_transactions_sent_calls_correct_url_with_passed_in_params(): ) client = ArkClient('http://127.0.0.1:4002/api') - client.wallets.transactions_sent(wallet_id, page=5, limit=69) + client.wallets.sent_transactions(wallet_id, page=5, limit=69) assert len(responses.calls) == 1 assert responses.calls[0].request.url.startswith( 'http://127.0.0.1:4002/api/wallets/12345/transactions/sent?' @@ -170,7 +170,7 @@ def test_transactions_sent_calls_correct_url_with_passed_in_params(): assert 'limit=69' in responses.calls[0].request.url -def test_transactions_received_calls_correct_url_with_default_params(): +def test_received_transactions_calls_correct_url_with_default_params(): wallet_id = '12345' responses.add( responses.GET, @@ -180,14 +180,14 @@ def test_transactions_received_calls_correct_url_with_default_params(): ) client = ArkClient('http://127.0.0.1:4002/api') - client.wallets.transactions_received(wallet_id) + client.wallets.received_transactions(wallet_id) assert len(responses.calls) == 1 assert responses.calls[0].request.url == ( 'http://127.0.0.1:4002/api/wallets/12345/transactions/received?limit=100' ) -def test_transactions_received_calls_correct_url_with_passed_in_params(): +def test_received_transactions_calls_correct_url_with_passed_in_params(): wallet_id = '12345' responses.add( responses.GET, @@ -197,7 +197,7 @@ def test_transactions_received_calls_correct_url_with_passed_in_params(): ) client = ArkClient('http://127.0.0.1:4002/api') - client.wallets.transactions_received(wallet_id, page=5, limit=69) + client.wallets.received_transactions(wallet_id, page=5, limit=69) assert len(responses.calls) == 1 assert responses.calls[0].request.url.startswith( 'http://127.0.0.1:4002/api/wallets/12345/transactions/received?'