-
Notifications
You must be signed in to change notification settings - Fork 145
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
Change Transaction/PendingTransaction
behaviors
#1480
Conversation
…mplify error handling
…afeWait() to simplify error handling
…er readability and consistency with other method names
…cess boolean with status enum for better clarity
… to improve robustness of the transaction flow test
…on status handling and error handling
…r transaction methods - Refactor send() method to throw an error when transaction submission fails, providing more explicit error handling. - Update send() method documentation to reflect changes and provide better usage examples. - Refactor safeSend() method to return a RejectedTransaction when internal errors are detected, providing more detailed feedback. - Update safeSend() method documentation to reflect changes and provide better usage examples. - Update wait() method usage examples in IncludedTransaction and RejectedTransaction to demonstrate error handling.
…action.safeWait() methods to handle transaction errors refactor(CHANGELOG.md): rename Transaction.isSuccess to Transaction.status for better transaction state representation
Transaction/PendingTransactio
behaviorsTransaction/PendingTransaction
behaviors
@MartinMinkov should we maybe also change the https://github.com/o1-labs/o1js/blob/feat/safe-send/src/examples/zkapps/hello-world/run-live.ts in order to check txn status instead of |
Great callout! I'll run through all the examples for usage of |
…d of hash for better transaction tracking This change will allow us to track the transaction status more accurately and handle it accordingly.
Thank you, if you don't have time I can take care of that zkapp-cli PR once o1js released, no worries. |
…ng error to allow further processing of the transaction status
CHANGELOG.md
Outdated
@@ -19,6 +19,9 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm | |||
|
|||
### Breaking changes | |||
|
|||
- Improved on parity fix of `Mina.Localblockchain` and`Mina.Network` to make `.send()` and `.wait()` throw an error by default if the transaction was not successful. https://github.com/o1-labs/o1js/pull/1480 | |||
- Changed `Transaction.isSuccess` to `Transaction.status` to better represent the state of a transaction. | |||
- `Transaction.safeSend()` and `PendingTransaction.safeWait()` are introduced to return a `IncludedTransaction` or `RejectedTransaction` object without throwing errors. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
since both of them are in the same release, it would be nice to collapse that changelog with the changes from #1422 mentioned below
for example not have both
.send()
no longer throws an error ....send()
throws an error by default ...
but just
.send()
when usingMina.Network
is now consistent withLocalBlockchain
in that it throws an error
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
great point! done!
…s in transaction parity
Description
Change the default behavior of
Transaction.send()
to throw an error if any errors are detected during processing. Additionally, we changeisSuccess
fromTransaction
and usestatus
instead to indicate the transaction's current status.status
can either bepending
orrejected
.Also changes the tests and documentation.