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

Add validator management page #425

Merged
merged 19 commits into from
Dec 6, 2024
Merged

Conversation

dmytrotkk
Copy link
Contributor

@dmytrotkk dmytrotkk commented Nov 12, 2024

In this PR:

  • Validator management page
  • Delegations list and actions for validator: accept pending delegation, unstake tokens, etc
  • Preview mode to validator (customAddress in the URL)
  • Chain rewards module
  • Notifications system for pending delegations
  • Updated Paymaster ABI
  • Other minor fixes

Copy link

vercel bot commented Nov 12, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
portal ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 6, 2024 1:10pm

@dmytrotkk dmytrotkk marked this pull request as ready for review November 21, 2024 19:32
src/App.scss Outdated
@@ -457,6 +461,14 @@ body::-webkit-scrollbar {
background: rgb(244 139 54 / 13%);
}

.btnprimary {
Copy link
Contributor

Choose a reason for hiding this comment

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

Flagged for Consistency: .btnprimary -> .btnPrimary

Copy link
Contributor Author

Choose a reason for hiding this comment

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

removed

@@ -76,6 +76,10 @@ body {
width: 100%;
}

.fullH {
Copy link
Contributor

Choose a reason for hiding this comment

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

Consistency: .fullH -> .fullHeight

.btnDisabled {
background: #262626;
}

.btnSmLoading {
Copy link
Contributor

Choose a reason for hiding this comment

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

Consistentcy: .btnSmallLoading

src/Portal.tsx Outdated
Copy link
Contributor

Choose a reason for hiding this comment

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

General note on useState setup in React.
You have mix and matched null and undefined.
Believe that the standard tends to lean toward undefined as the "best practice" but in this case just consistency flag that it might be good to have them all the same

@@ -43,7 +43,7 @@ export default function ErrorTile(props: {
icon={<ErrorRoundedIcon />}
color="error"
grow
children={
childrenRi={
Copy link
Contributor

Choose a reason for hiding this comment

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

This needs more explicit naming I think.
Since children can be "passed through" e.g <>{children}</> the Ri flag on first look seems like a typo

const description = props.validator.description ? props.validator.description : 'No description'
const minDelegation = fromWei(props.validator.minimumDelegationAmount, DEFAULT_ERC20_DECIMALS)
export default function ValidatorInfo(props: {
validator: types.staking.IValidator | null
Copy link
Contributor

Choose a reason for hiding this comment

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

undefined over null?

Comment on lines +36 to +37
sc: types.staking.ISkaleContractsMap | null
address: types.AddressType | undefined
Copy link
Contributor

Choose a reason for hiding this comment

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

undefined or null

}: {
delegationType: types.staking.DelegationType
txName: string
txArgs: any[]
Copy link
Contributor

Choose a reason for hiding this comment

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

Avoid any if possible


const [currentValidator, setCurrentValidator] = useState<IValidator | undefined>(undefined)
const [currentValidator, setCurrentValidator] = useState<types.staking.IValidator | undefined>(
Copy link
Contributor

Choose a reason for hiding this comment

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

undefined types initial state being empty defaults to undefined

address: types.AddressType | undefined
customAddress: types.AddressType | undefined
loadValidator: () => Promise<void>
validator: types.staking.IValidator | null | undefined
Copy link
Contributor

Choose a reason for hiding this comment

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

null and undefined should not be possible

@dmytrotkk dmytrotkk merged commit 708ee7e into develop Dec 6, 2024
2 of 4 checks passed
@dmytrotkk dmytrotkk deleted the add-validator-management-page branch December 6, 2024 13:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants