From a0893167b2a73a1f0280d2e05ef3d442a1f44c3d Mon Sep 17 00:00:00 2001 From: Ross Spencer Date: Mon, 3 Jul 2023 08:40:23 +0200 Subject: [PATCH 1/2] Ensure that arql query returns transaction list --- arweave/arweave_lib.py | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/arweave/arweave_lib.py b/arweave/arweave_lib.py index 87292ff..97d78b5 100644 --- a/arweave/arweave_lib.py +++ b/arweave/arweave_lib.py @@ -477,13 +477,12 @@ def arql_with_transaction_data(wallet, query): """ transaction_ids = arql(wallet, query) - if transaction_ids: - transactions = [] - for transaction_id in transaction_ids: - tx = Transaction(wallet, id=transaction_id) - tx.get_transaction() - tx.get_data() - - transactions.append(tx) - - return None + if not transaction_ids: + return None + transactions = [] + for transaction_id in transaction_ids: + tx = Transaction(wallet, id=transaction_id) + tx.get_transaction() + tx.get_data() + transactions.append(tx) + return transactions From f41c1c089bc89719c08fc2a4b8472b0b44c32d70 Mon Sep 17 00:00:00 2001 From: Ross Spencer Date: Mon, 3 Jul 2023 08:46:50 +0200 Subject: [PATCH 2/2] Fixup imports for arql queries in README --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 01e0d2e..1d37689 100644 --- a/README.md +++ b/README.md @@ -126,6 +126,7 @@ transaction.api_url = 'some specific node ip/address and port' ## Arql You can now perform searches using the arql method: ```buildoutcfg +import arweave from arweave.arweave_lib import arql wallet_file_path = "/some/folder/on/your/system" @@ -143,11 +144,12 @@ transaction_ids = arql( Alternatively, you can use a the helper method arql_with_transaction_data() to get all transaction ids as well as all the data stored in the blockchain ```buildoutcfg import arweave +from arweave.arweave_lib import arql_with_transaction_data wallet_file_path = "/some/folder/on/your/system" wallet = arweave.Wallet(wallet_file_path) -transactions = aweave.arql_with_transaction_data( +transactions = arql_with_transaction_data( wallet, { "op": "equals",