fix(DelegatingWidget): Add dialog for unbonding all stake#451
Merged
ECWireless merged 4 commits intomainfrom Dec 19, 2025
Merged
Conversation
- Show confirmation dialog when unbonding all stake as an orchestrator - Display deactivation notice in success message post-transaction - Add willDeactivate/wasDeactivated flags to track deactivation state
…vation check - Replace lossy float conversion with BigInt to fix precision errors on large stakes - Wait for pendingStake to load before evaluating willDeactivate - Disable confirm button when contract simulation isn't ready
…nt function - Cast newPosPrev and newPosNext to the expected hex string format
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds a confirmation dialog to warn orchestrators before they unbond all their stake, which would deactivate them from the active set. It also fixes a precision loss bug by replacing lossy float conversion with BigInt for stake comparisons.
Key Changes:
- Added pre-transaction confirmation dialog with deactivation warning when orchestrators attempt to unbond all stake
- Fixed precision loss bug by converting stake comparisons from float operations to BigInt operations
- Added post-transaction success message showing orchestrator deactivation status
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| hooks/useExplorerStore.tsx | Added wasDeactivated flag to InputData type for tracking deactivation state in transaction data |
| components/TxConfirmedDialog/index.tsx | Updated success dialog to conditionally display orchestrator deactivation message when unbonding completes |
| components/DelegatingWidget/Undelegate.tsx | Added confirmation dialog UI with deactivation warning, implemented conditional dialog flow based on willDeactivate flag, and added TypeScript Props interface |
| components/DelegatingWidget/Footer.tsx | Fixed precision loss by converting stake comparison from float to BigInt, added willDeactivate calculation logic with proper guards for data loading, and passed flag to Undelegate component |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…s-unbonding-all-stake
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.
Description
Add confirmation dialog warning orchestrators before they unbond all stake, which would deactivate them from the active set.
Type of Change
Related Issue
Closes #190
Changes Made
willDeactivatecheck to wait forpendingStakedata before evaluatingwasDeactivatedflag to transaction input data for success message renderingTesting
Screenshots (if applicable)
Checklist
Additional Notes
Dialog copy: