fixed wrong index name issue: transaction_by_asset vs transaction_by_asset_id

Signed-off-by: Jürgen Eckel <juergen@riddleandcode.com>
This commit is contained in:
Jürgen Eckel 2023-01-10 09:45:33 +01:00
parent 7fc69a0e8a
commit 69e6cf7df0
No known key found for this signature in database
2 changed files with 3 additions and 3 deletions

View File

@ -14,5 +14,5 @@ TARANT_TABLE_SCRIPT = "scripts"
TARANT_TX_ID_SEARCH = "transaction_id"
TARANT_ID_SEARCH = "id"
TARANT_INDEX_TX_BY_ASSET_ID = "transactions_by_asset"
TARANT_INDEX_TX_BY_ASSET_ID = "transactions_by_asset_id"
TARANT_INDEX_SPENDING_BY_ID_AND_OUTPUT_INDEX = "spending_transaction_by_id_and_output_index"

View File

@ -242,12 +242,12 @@ def get_txids_filtered(connection, asset_ids: list[str], operation: str = "", la
)
elif operation == "TRANSFER":
transactions = connection.run(
connection.space(TARANT_TABLE_TRANSACTION).select(asset_ids, index="transactions_by_asset")
connection.space(TARANT_TABLE_TRANSACTION).select(asset_ids, index=TARANT_INDEX_TX_BY_ASSET_ID)
)
else:
txs = connection.run(connection.space(TARANT_TABLE_TRANSACTION).select(asset_ids, index=TARANT_ID_SEARCH))
asset_txs = connection.run(
connection.space(TARANT_TABLE_TRANSACTION).select(asset_ids, index="transactions_by_asset")
connection.space(TARANT_TABLE_TRANSACTION).select(asset_ids, index=TARANT_INDEX_TX_BY_ASSET_ID)
)
transactions = txs + asset_txs