-
Notifications
You must be signed in to change notification settings - Fork 573
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
refactor(ironfish): do not quit transaction:watch if the transaction is not found #3726
Conversation
3f4d36d
to
723c886
Compare
723c886
to
8d741ee
Compare
8d741ee
to
617ddb9
Compare
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.
This looks good. I think the one other UX change I'd consider making is integrating the "not found" status into the other loop, so the CLI output of both loops matched up but displays e.g. "not found" instead of "pending". This is a net improvement though so I'm good with merging it!
6a04019
to
12db961
Compare
Made the UX changes, now the spinner shows when the transaction is in the |
2f3ef6f
to
a463506
Compare
- add TransactionStatus.NOT_FOUND for managing the status of a transaction that cannot currently be retrieved
a463506
to
58da34d
Compare
logger.log(`Tried to watch transaction ${options.hash} but it's missing.`) | ||
return | ||
} | ||
let prevStatus = last?.content.transaction?.status ?? TransactionStatus.NOT_FOUND |
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.
I don't think we should add NOT_FOUND to TransactionStatus, since TransactionStatus is used for the status field of an existing transaction. In this case, we're just using it for display purposes.
Another way I think about it is that the ironfish
package internally doesn't use the NOT_FOUND status, so I don't think we should change the enum just for the convenience of writing external (ironfish-cli
) code.
I think you could type this as type TransactionWatchStatus = TransactionStatus | 'not found'
and everything should just work.
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.
removed changes to TransactionStatus
Summary
ironfish wallet:transactions:watch
no longer quits if the transaction is not found. TheNOT_FOUND
state has been added as aTransactionStatus
and is now integrated into the watch status loopCloses IFL-413
Testing Plan
Successful watch:
If txn not found, then
watchTransaction()
loop foreverDocumentation
Does this change require any updates to the Iron Fish Docs (ex. the RPC API
Reference)? If yes, link a
related documentation pull request for the website.
Breaking Change
Is this a breaking change? If yes, add notes below on why this is breaking and
what additional work is required, if any.