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

Verify submitted transaction is not malformed before waiting for its final outcome. #379

Merged
merged 8 commits into from
Apr 26, 2022
3 changes: 3 additions & 0 deletions xrpl/asyncio/transaction/reliable_submission.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ async def send_reliable_submission(
Raises:
XRPLReliableSubmissionException: if the transaction fails or is missing a
`last_ledger_sequence` param.
Exception: if the submitted transaction's `engine_result` is not `tesSUCCESS`
"""
if transaction.last_ledger_sequence is None:
raise XRPLReliableSubmissionException(
Expand All @@ -89,6 +90,8 @@ async def send_reliable_submission(
transaction_hash = transaction.get_hash()
submit_response = await submit_transaction(transaction, client)
prelim_result = submit_response.result["engine_result"]
if prelim_result != "tesSUCCESS":
khancode marked this conversation as resolved.
Show resolved Hide resolved
raise Exception(submit_response.result["engine_result_message"])
khancode marked this conversation as resolved.
Show resolved Hide resolved
khancode marked this conversation as resolved.
Show resolved Hide resolved

return await _wait_for_final_transaction_outcome(
transaction_hash, client, prelim_result
Expand Down