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
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added:
- Support for dynamic fee calculation

### Fixed
- Resolve `txnNotFound` error with `send_reliable_submission` when waiting for a submitted malformed transaction

## [1.5.0] - 2022-04-25
### Added
- Support setting flags with booleans. For each transaction type supporting flags there is a `FlagInterface` to set the flags with booleans.
Expand Down
8 changes: 6 additions & 2 deletions xrpl/asyncio/transaction/reliable_submission.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ async def send_reliable_submission(
The response from a validated ledger.

Raises:
XRPLReliableSubmissionException: if the transaction fails or is missing a
`last_ledger_sequence` param.
XRPLReliableSubmissionException: if the transaction fails, is malformed, or is
missing a `last_ledger_sequence` param.
"""
if transaction.last_ledger_sequence is None:
raise XRPLReliableSubmissionException(
Expand All @@ -89,6 +89,10 @@ 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[0:3] == "tem":
raise XRPLReliableSubmissionException(
submit_response.result["engine_result_message"]
)

return await _wait_for_final_transaction_outcome(
transaction_hash, client, prelim_result
Expand Down