Skip to content

Commit

Permalink
Verify submitted transaction is not malformed before waiting for its …
Browse files Browse the repository at this point in the history
…final outcome. (#379)

* Verify submitted transaction is not malformed before waiting for its final outcome. (#379)
  • Loading branch information
khancode committed Apr 26, 2022
1 parent b82b004 commit b7d6aaf
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
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
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

0 comments on commit b7d6aaf

Please sign in to comment.