-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
feat(status-page): show latest proof reward #13842
Conversation
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.
Overall, this Pull Request looks good. Here are my comments:
- In the StatusIndicator.svelte component, the statusValue should be set to an empty string instead of "Waiting for event..."
- In the status.ts file, the watchStatusFunc should return a Promise instead of a function.
- In buildStatusIndicators.ts, the tooltip for the Proof Reward indicator should be updated to include the average proof time.
- The colorFunc for both indicators should be updated to reflect green, yellow, and red colors based on the status value.
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.
Overall, this Pull Request looks good. Here are some points for consideration:
- The code in the first patch is missing a semicolon after the
onEvent
function declaration. - The second patch should include a comment to explain why the
reward
variable is being cast to a string. - The code should be formatted consistently throughout the Pull Request.
- The variable names should also be consistent throughout the Pull Request. For example,
provider
is used in some places butcontractProvider
is used in others.
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.
Overall, this pull request looks to be in good shape. There are a few minor issues I noticed:
- In the first patch, the comment in line 11 of Status.ts is out of date and should be updated.
- In the second patch, it looks like the string needs to be converted to a string before being parsed in line 317 of buildStatusIndicators.ts.
- In the third patch, it might be a good idea to add a comment explaining why this check is necessary in line 58 of StatusIndicator.svelte.
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.
Overall, this pull request looks good. There are a few things I noticed that could be improved, however:
- The comment on line 59 of StatusIndicator.svelte should be updated to make it clearer what the code is doing.
- The comment on line 11 of status.ts should also be updated to make it clearer what the code is doing.
- The comment on line 362 of buildStatusIndicators.ts should also be updated to make it clearer what the code is doing.
- The code on line 329 of buildStatusIndicators.ts should be updated to use ethers.utils.formatUnits instead of ethers.utils.parseUnits, as the variable being used is a BigNumber.
- The comment on line 365 of buildStatusIndicators.ts should be updated to reflect that the color will always be green, as there are no other options in this case.
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.
Overall, the code changes look good. Here are some points to consider:
- It looks like the code formatting could be improved in the StatusIndicator and buildStatusIndicators files.
- The comment above the colorFunc function in buildStatusIndicators.ts could be improved with more information about what each color represents.
- The statusFunc function in buildStatusIndicators.ts should use the parseUnits method instead of formatUnits for consistency with other functions.
- The watchStatusFunc function in buildStatusIndicators.ts should have a return type of Promise<() => void> for consistency with other functions.
- The tooltip for the proof reward indicator should include information about the average proof time.
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.
Overall, this pull request looks good. Here are a few suggestions:
- It appears that the
watchStatusFunc
in thebuildStatusIndicators
function is missing a return type. It should bePromise<() => void>
. - In the same function, consider adding a type to the
listener
function. - In the
buildStatusIndicators
function, consider adding a type to thestatusFunc
function. - Consider renaming the
statusValue
variable in theStatusIndicator
component to something more descriptive. - Consider adding a comment to clarify why you are using
toString()
when callingethers.utils.parseUnits()
andethers.utils.formatUnits()
. - Consider adding a comment to explain why you are using
latestBlockNumber - 200
when callingcontract.queryFilter()
. - Consider adding more comments in general for clarity and readability.
No description provided.