Skip to content

feat: Add validators fee voting tab & reorganize Network tab #1098

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

Open
wants to merge 7 commits into
base: staging
Choose a base branch
from

Conversation

pdp2121
Copy link
Collaborator

@pdp2121 pdp2121 commented Dec 11, 2024

High Level Overview of Change

This PR is trying to achieve the following:

  • Add voting (for fee voting) and uptime (similar to the existing page) for validators page.
  • Remove "validators", "nodes", and "upgrade status" tabs for Network. Each now would be a separate page under Network in top nav bar.
  • Refactor ValidatorsTable.jsx into TypeScript hooks.

Resolve: #1058

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Refactor (non-breaking change that only restructures code)
  • Tests (You added tests for code that already exists, or your new feature included in this PR)
  • Documentation Updates
  • Translation Updates
  • Release

TypeScript/Hooks Update

  • Updated files to React Hooks
  • Updated files to TypeScript

Before / After

Validators page (Uptime):
Screenshot 2024-12-11 at 11 54 28 AM

Validators page (Voting):
Screenshot 2024-12-11 at 1 39 56 PM

Voting Mobile View:

Screenshot 2024-12-11 at 1 40 39 PM

Upgrade Status:
Screenshot 2024-12-11 at 1 41 16 PM

@@ -509,6 +509,17 @@ const getServerInfo = (rippledSocket) =>
return resp
})

const getServerState = (rippledSocket) =>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit - might be worth it to add comments between this and getServerInfo, at a glance it is hard to tell what each is for. I don't feel strongly about this though so either way

Comment on lines +104 to +106
base_fee?: number
reserve_base?: number
reserve_inc?: number
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you make this a union of objects that includes feesettings? seems like all 3 would always be included together (you wouldn't just have base fee or reserve fee for example) since its all part of the same object below

@@ -22,6 +22,7 @@ export const FETCH_INTERVAL_VHS_MILLIS = 60 * 1000 // 1 minute
export const FETCH_INTERVAL_NODES_MILLIS = 60000
export const FETCH_INTERVAL_ERROR_MILLIS = 300
export const FETCH_INTERVAL_XRP_USD_ORACLE_MILLIS = 60 * 1000
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
export const FETCH_INTERVAL_XRP_USD_ORACLE_MILLIS = 60 * 1000
export const FETCH_INTERVAL_XRP_USD_ORACLE_MILLIS = 60 * 1000 // 1 minute

import { useLanguage } from '../shared/hooks'
import { renderXRP } from '../shared/utils'

const DROPS_TO_XRP_FACTOR = 1000000
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: is this not a const somewhere global for the repo? seems like it would be used elsewhere

const renderDomain = (domain) => domain && <DomainLink domain={domain} />

const renderAgreement = (className, d) =>
d ? (
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: can we rename variable d to a more interpretive param name

Copy link
Collaborator

@achowdhry-ripple achowdhry-ripple left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only nitpicks on my end, looks good overall though

function fetchFeeSettingsData() {
if (tab === 'voting') {
getServerState(rippledSocket)
.then((res) => res.state)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tiny nit: since line 86 isnt an async operation, can we just extract in the following then clause instead of separately here

Copy link
Collaborator

@achowdhry-ripple achowdhry-ripple left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, thanks for this

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.

Feature request: Page for fee voting
2 participants