From b5b661ed5131a92a01f8e6c4e0aee1de1950f310 Mon Sep 17 00:00:00 2001 From: Alex Barnsley <8069294+alexbarnsley@users.noreply.github.com> Date: Wed, 26 Mar 2025 17:27:19 +0000 Subject: [PATCH 1/3] refactor: add transactions configuration endpoint --- client/api/transactions.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/client/api/transactions.py b/client/api/transactions.py index 23720cf..1e26005 100644 --- a/client/api/transactions.py +++ b/client/api/transactions.py @@ -30,6 +30,9 @@ def all_unconfirmed(self, limit=100, offset=None, **kwargs): def get_unconfirmed(self, transaction_id): return self.with_endpoint('api').request_get(f'transactions/unconfirmed/{transaction_id}') + def configuration(self): + return self.with_endpoint('transactions').request_get('configuration') + def types(self): return self.with_endpoint('api').request_get('transactions/types') From 9f02bb61b2203878ddf4ba8a91f189e558070c48 Mon Sep 17 00:00:00 2001 From: Alex Barnsley <8069294+alexbarnsley@users.noreply.github.com> Date: Wed, 26 Mar 2025 17:27:38 +0000 Subject: [PATCH 2/3] remove redundant tx endpoint methods --- client/api/transactions.py | 9 --------- 1 file changed, 9 deletions(-) diff --git a/client/api/transactions.py b/client/api/transactions.py index 1e26005..7955d73 100644 --- a/client/api/transactions.py +++ b/client/api/transactions.py @@ -32,12 +32,3 @@ def get_unconfirmed(self, transaction_id): def configuration(self): return self.with_endpoint('transactions').request_get('configuration') - - def types(self): - return self.with_endpoint('api').request_get('transactions/types') - - def fees(self): - return self.with_endpoint('api').request_get('transactions/fees') - - def schemas(self): - return self.with_endpoint('api').request_get('transactions/schemas') From beecf4128d30ca111cdb4bdc04a8237eb4795b3c Mon Sep 17 00:00:00 2001 From: Alex Barnsley <8069294+alexbarnsley@users.noreply.github.com> Date: Wed, 26 Mar 2025 17:27:42 +0000 Subject: [PATCH 3/3] test --- tests/api/test_transactions.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/tests/api/test_transactions.py b/tests/api/test_transactions.py index dde6db9..fbc5412 100644 --- a/tests/api/test_transactions.py +++ b/tests/api/test_transactions.py @@ -135,15 +135,19 @@ def test_all_unconfirmed_calls_correct_url_with_additional_params(): assert 'limit=69' in responses.calls[0].request.url assert 'orderBy=timestamp.epoch' in responses.calls[0].request.url -def test_schemas_calls_correct_url(): +def test_configuration_calls_correct_url(): responses.add( responses.GET, - 'http://127.0.0.1:4002/api/transactions/schemas', + 'http://127.0.0.1:4002/tx/api/configuration', json={'success': True}, status=200 ) - client = ArkClient('http://127.0.0.1:4002/api') - client.transactions.schemas() + client = ArkClient({ + 'api': 'http://127.0.0.1:4002/api', + 'transactions': 'http://127.0.0.1:4002/tx/api', + 'evm': None, + }) + client.transactions.configuration() assert len(responses.calls) == 1 - assert responses.calls[0].request.url == 'http://127.0.0.1:4002/api/transactions/schemas' + assert responses.calls[0].request.url == 'http://127.0.0.1:4002/tx/api/configuration'