Skip to content

Commit

Permalink
fix: ensure that an invalid txhash will not halt the sync command (#9699
Browse files Browse the repository at this point in the history
)
  • Loading branch information
gdixon authored Nov 18, 2021
1 parent 635953e commit ecabf0b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions app/dashboard/sync/tezos.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ def get_tezos_txn_status(fulfillment):

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

if tx_response:
# a valid response will return a list whereas an invalid response will return a dict
if tx_response and isinstance(tx_response, list) and len(tx_response) > 0:
tx_response = tx_response[0]
block_tip = requests.get(f'{BASE_URL}/head').json()['level']
confirmations = block_tip - tx_response['level']
Expand All @@ -70,7 +71,7 @@ def sync_tezos_payout(fulfillment):
if txn:
fulfillment.payout_tx_id = txn['hash']
fulfillment.save()

if fulfillment.payout_tx_id and fulfillment.payout_tx_id != "0x0":
txn_status = get_tezos_txn_status(fulfillment)

Expand Down

0 comments on commit ecabf0b

Please sign in to comment.