Skip to content

Commit ecabf0b

Browse files
authored
fix: ensure that an invalid txhash will not halt the sync command (#9699)
1 parent 635953e commit ecabf0b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

app/dashboard/sync/tezos.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@ def get_tezos_txn_status(fulfillment):
4646

4747
tx_response = requests.get(f'{BASE_URL}/operations/{txnid}').json()
4848

49-
if tx_response:
49+
# a valid response will return a list whereas an invalid response will return a dict
50+
if tx_response and isinstance(tx_response, list) and len(tx_response) > 0:
5051
tx_response = tx_response[0]
5152
block_tip = requests.get(f'{BASE_URL}/head').json()['level']
5253
confirmations = block_tip - tx_response['level']
@@ -70,7 +71,7 @@ def sync_tezos_payout(fulfillment):
7071
if txn:
7172
fulfillment.payout_tx_id = txn['hash']
7273
fulfillment.save()
73-
74+
7475
if fulfillment.payout_tx_id and fulfillment.payout_tx_id != "0x0":
7576
txn_status = get_tezos_txn_status(fulfillment)
7677

0 commit comments

Comments
 (0)