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
Adds a transaction timer class to reuse #4852
Conversation
) { | ||
this.logger = logger ?? createRootLogger() | ||
this.estimateInMs = Math.max(Math.ceil(spendPostTime * raw.spends.length), 1000) | ||
options.displayEstimate && this.displayEstimate() |
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.
Nit: it is unusual for constructors to have side-effects (in this case, printing something). I would make this behavior more explicit and require callers to call this method explicitly
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 feedback, I had it that way originally and I'll change it back
const progress = Math.round((durationInMs / this.estimateInMs) * 100) | ||
|
||
this.progressBar.update(progress, { | ||
estimate: TimeUtils.renderSpan(timeRemaining, { hideMilliseconds: true }), |
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.
If timeRemaining
is negative, this will show a negative estimate. Is there a way to show "unknown" or maybe "soon" instead?
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.
The behavior currently involves "counting up" after the countdown is complete. I talked through some options with Jason when initially implementing this and this seemed like the best one. This PR is only a refactor, so I'll leave as is but I'll continue to think through more options.
Summary
Adds a transaction timer class that abstracts the timer logic away from combine notes.
This is in setup for adding the timer to
wallet:send
Testing Plan
Documentation
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 label it with
breaking-change-rpc
orbreaking-change-sdk
.