-
-
Notifications
You must be signed in to change notification settings - Fork 267
Add getNonceLock method #1859
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
Add getNonceLock method #1859
Conversation
| expect(transactionsListener).toHaveBeenCalledTimes(0); | ||
| }); | ||
|
|
||
| it('logs error while checking the status of a submitted transaction', async () => { |
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.
A pattern for us to decide on, but typically I don't create unit tests for logging as it's not true business logic, but rather just to aid debugging so could bloat the test file if we did it for every instance.
That said, we could adapt this unit test to instead just ensure we don't throw in the event listener if the query fails?
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 agree, most of the time it's not worth creating unit tests for logging.
As it's already done I adapted as you suggested.
packages/transaction-controller/src/helpers/PendingTransactionTracker.ts
Show resolved
Hide resolved
Co-authored-by: Matthew Walsh <matthew.walsh@consensys.net>
f6a599a to
97c3698
Compare
Explanation
The extension
TransactionControllerexposes thenonceTrackerproperty from which thegetNonceLockmethod is used by UI and some other controllers. This PR aims to expose to the public API thegetNonceLock.GlobalNonceLockbefore starting checking for submitted transactions inPendingtransactionTracker.getNonceLockin theTransactionController.References
Changelog
@metamask/transaction-controllerNonceTrackertoPendingTransactionTracker.getNonceLockenabling to retrieve the next nonce according to the nonce-tracker.Checklist