Open
Conversation
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
There was a problem hiding this comment.
Pull request overview
Adds user-facing LIP-36 warnings around delegation actions (delegate/undelegate/move stake/rebond/withdraw fees) to help users avoid forfeiting rewards/fees when acting before an orchestrator calls reward() in the current round.
Changes:
- Extend the account GraphQL query/types to include
lastRewardRoundon relevant transcoders/delegates. - Introduce
useDelegationReview(andgetDelegationWarning) to centralize warning logic, plus aDelegationReviewUI component for inline alerts. - Integrate warning display into delegation/redelegate/withdraw flows (inline alerts + tooltip icons) and adjust StakeTransactions layout.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| queries/account.graphql | Fetches lastRewardRound for delegator delegate + unbonding lock delegate to support warning logic. |
| apollo/subgraph.ts | Updates generated AccountQuery types/document to include lastRewardRound. |
| hooks/useDelegationReview.tsx | Adds centralized warning logic based on lastRewardRound vs currentRound. |
| hooks/useDelegationReview.test.ts | Adds initial unit tests for the warning logic (rebond-from-unbonded path). |
| hooks/index.tsx | Re-exports useDelegationReview from the hooks barrel. |
| components/DelegationReview/index.tsx | New inline warning UI (yellow alert styling). |
| components/DelegatingWidget/Footer.tsx | Shows inline warnings for delegate/undelegate/move stake flows. |
| components/DelegatingView/index.tsx | Shows inline warning on “Withdraw Pending Fees” action. |
| components/Redelegate/index.tsx | Adds warning icon tooltip next to “Redelegate” action. |
| components/RedelegateFromUndelegated/index.tsx | Adds warning icon tooltip and wires target orchestrator context for rebond-from-unbonded. |
| components/StakeTransactions/index.tsx | Passes delegator/currentRound into redelegation components and adjusts alignment for responsiveness. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See #524 for all details. Original PR created by @Roaring30s .