Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IF: Test: trx_finality_status_forked_test #2343

Merged
merged 2 commits into from
Mar 28, 2024
Merged

Conversation

heifner
Copy link
Member

@heifner heifner commented Mar 27, 2024

Does not fix issue reported in #2310. This PR is to make reporting of errors better.

Use getBlockNum() and getBlockID() for accessing get transaction-status results.

IN_BLOCK status returns block_number and block_id.
LOCALLY_APPLIED status returns head_number and head_id.

cmd={/__w/leap/leap/build/bin/cleos --url http://localhost:8891 --wallet-url http://localhost:9899 --no-auto-keosd get transaction-status fb2a71ec0e490bf8989f1cfaa9f6a16c0367ec8078f8492477026ff7c5029be4}
cout={b'{\n  "state": "IN_BLOCK",\n  "block_number": 199,\n  "block_id": "000000c7bfc26343def2c691bd7fed57880c320a9cef930fa8f16ffbb86e23c1",\n  "block_timestamp": "2024-03-27T17:12:45.000",\n  "expiration": "2024-03-27T17:14:12.000",\n  "head_number": 200,\n  "head_id": "000000c898855776f59986582451d5db32dea5d9a728b947b2bbc1afab63bb75",\n  "head_timestamp": "2024-03-27T17:12:45.500",\n  "irreversible_number": 195,\n  "irreversible_id": "000000c3d939ef3af111e203cedbb711cf2e56449df8b27d5cee7cef7241677b",\n  "irreversible_timestamp": "2024-03-27T17:12:37.000",\n  "earliest_tracked_block_id": "0000002033fc0440771c1748b11c16aa0d3994e4df53b5c52749677e85726b77",\n  "earliest_tracked_block_number": 32\n}\n'}

and

cmd={/__w/leap/leap/build/bin/cleos --url http://localhost:8891 --wallet-url http://localhost:9899 --no-auto-keosd get transaction-status fb2a71ec0e490bf8989f1cfaa9f6a16c0367ec8078f8492477026ff7c5029be4}
cout={b'{\n  "state": "LOCALLY_APPLIED",\n  "expiration": "2024-03-27T17:14:12.000",\n  "head_number": 204,\n  "head_id": "000000cc0772681d58d77c81e61ebf0f71270d539dc8cf8b51e4b24ce5bcd010",\n  "head_timestamp": "2024-03-27T17:12:41.500",\n  "irreversible_number": 201,\n  "irreversible_id": "000000c982efd5f794d1f90c7b4b38e5d495cb52fbf7338ad4fcdd25e57264a9",\n  "irreversible_timestamp": "2024-03-27T17:12:40.000",\n  "earliest_tracked_block_id": "0000002033fc0440771c1748b11c16aa0d3994e4df53b5c52749677e85726b77",\n  "earliest_tracked_block_number": 32\n}\n'}

@heifner heifner added the OCI Work exclusive to OCI team label Mar 27, 2024
@heifner heifner requested review from greg7mdp and linh2931 March 27, 2024 17:51
if "block_number" in status:
return status["block_number"]
assert "head_number" in status, \
f"ERROR: getTransactionStatus returned a status object that didn't have a \"head_number\" field. state: {json.dumps(status, indent=1)}"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be better state: to be status: to match status object just a few words before,

@heifner heifner merged commit ae08070 into hotstuff_integration Mar 28, 2024
34 checks passed
@heifner heifner deleted the GH-2310-test branch March 28, 2024 15:46
@ericpassmore
Copy link
Contributor

Note:start
group: IF
category: TEST
summary: Update test with improved error logging.
Note:end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OCI Work exclusive to OCI team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants