From 00240286ccbd50b98020c4c6d3c718240cb97db2 Mon Sep 17 00:00:00 2001 From: Uxio Fuentefria <6909403+Uxio0@users.noreply.github.com> Date: Tue, 29 Oct 2024 15:00:43 +0100 Subject: [PATCH] Log error when retrieving EthereumTx --- safe_transaction_service/history/services/index_service.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/safe_transaction_service/history/services/index_service.py b/safe_transaction_service/history/services/index_service.py index a7003b09d..40b53f521 100644 --- a/safe_transaction_service/history/services/index_service.py +++ b/safe_transaction_service/history/services/index_service.py @@ -332,6 +332,12 @@ def txs_create_or_update_from_tx_hashes( ethereum_tx.update_with_block_and_receipt(ethereum_block, tx_receipt) ethereum_txs_dict[ethereum_tx.tx_hash] = ethereum_tx logger.debug("Blocks, transactions and receipts were inserted") + + # TODO Remove, this is meant to detect a bug on production + for tx_hash, ethereum_tx in ethereum_txs_dict.items(): + if not ethereum_tx: + logger.error("Unexpected missing tx with tx-hash=%s", tx_hash) + return list(ethereum_txs_dict.values()) @transaction.atomic