Skip to content
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

Merged
merged 7 commits into from
May 31, 2023

Conversation

cyberhorsey
Copy link
Contributor

@cyberhorsey cyberhorsey commented May 31, 2023

No description provided.

Copy link
Contributor

@github-actions github-actions bot left a 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.

dantaik
dantaik previously approved these changes May 31, 2023
Copy link
Contributor

@github-actions github-actions bot left a 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 but contractProvider is used in others.

Copy link
Contributor

@github-actions github-actions bot left a 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.

dantaik
dantaik previously approved these changes May 31, 2023
Copy link
Contributor

@github-actions github-actions bot left a 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.

Copy link
Contributor

@github-actions github-actions bot left a 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.

Copy link
Contributor

@github-actions github-actions bot left a 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 the buildStatusIndicators function is missing a return type. It should be Promise<() => void>.
  • In the same function, consider adding a type to the listener function.
  • In the buildStatusIndicators function, consider adding a type to the statusFunc function.
  • Consider renaming the statusValue variable in the StatusIndicator component to something more descriptive.
  • Consider adding a comment to clarify why you are using toString() when calling ethers.utils.parseUnits() and ethers.utils.formatUnits().
  • Consider adding a comment to explain why you are using latestBlockNumber - 200 when calling contract.queryFilter().
  • Consider adding more comments in general for clarity and readability.

@cyberhorsey cyberhorsey enabled auto-merge May 31, 2023 02:21
@cyberhorsey cyberhorsey added this pull request to the merge queue May 31, 2023
Merged via the queue into main with commit 12a6d04 May 31, 2023
@cyberhorsey cyberhorsey deleted the most_recent_proof_reward_status branch May 31, 2023 03:14
@github-actions github-actions bot mentioned this pull request May 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants