Skip to content

Commit

Permalink
GH-2102 Handle corner case of trx locally applied but not in a block yet
Browse files Browse the repository at this point in the history
  • Loading branch information
heifner committed Apr 4, 2024
1 parent 9411c05 commit 0c82e7a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tests/trx_finality_status_forked_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ def getBlockID(status):

if state == irreversibleState:
Print(f"Transaction became irreversible before it could be found forked out: {json.dumps(retStatus, indent=1)}")
testSuccessful = True
sys.exit(0)

assert state == forkedOutState, \
Expand All @@ -209,7 +210,7 @@ def getBlockID(status):
info = prodD.getInfo()
retStatus = prodD.getTransactionStatus(transId)
state = getState(retStatus)
blockNum = getBlockNum(retStatus)
blockNum = getBlockNum(retStatus) + 2 # Add 2 to give time to move from locally applied to in-block
if (state == inBlockState or state == irreversibleState) or ( info['head_block_producer'] == 'defproducerd' and info['last_irreversible_block_num'] > blockNum ):
break

Expand Down

0 comments on commit 0c82e7a

Please sign in to comment.