Skip to content

fix: report the submitted amount in the delegation confirmation#742

Open
rickstaa wants to merge 1 commit into
mainfrom
fix/delegate-confirmation-amount
Open

fix: report the submitted amount in the delegation confirmation#742
rickstaa wants to merge 1 commit into
mainfrom
fix/delegate-confirmation-amount

Conversation

@rickstaa

Copy link
Copy Markdown
Member

Fixes #741.

Problem

Every plain delegation confirms with the stake-migration copy:

Congrats! You've successfully migrated your stake to a new orchestrator.

TxConfirmedDialog/index.tsx:120 selects that from Number(tx.inputData.amount) <= 0, which is the right rule — a genuine "Move Delegated Stake" bonds zero. The problem is the amount it reads.

onDelegate submits and then calls reset()setAmount("") immediately, without waiting for the hash. useHandleTransaction's useEffect(..., [data]) runs later and records the current args, by which point the amount is 0. The hash can never arrive before reset(), so it happens on every delegation rather than intermittently.

Fix

Capture the args when the transaction is submitted and pass those to useHandleTransaction, falling back to the live ones before submission.

Display only — the calldata is unchanged, and unbond is unaffected since Undelegate.tsx never calls reset().

Testing

Not verified against a wallet. Delegating a real amount should confirm with "successfully delegated N LPT", and Move Delegated Stake should still show the migration copy, since that path legitimately bonds zero.

Note

This is the third item from #739, split out because it is self-contained. That issue still covers the receipt-waiting and cache-invalidation work in the same hook.

🤖 Generated with Claude Code

onDelegate clears the amount immediately after submitting, long before the
transaction hash arrives, so useHandleTransaction recorded an amount of 0. The
confirmation dialog reads that as a zero-value bond and reports a stake
migration for every delegation.

Capture the args on submit and record those instead.

Fixes #741

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@rickstaa
rickstaa requested a review from ECWireless as a code owner July 21, 2026 12:26
Copilot AI review requested due to automatic review settings July 21, 2026 12:26
@vercel

vercel Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
explorer-arbitrum-one Ready Ready Preview, Comment Jul 21, 2026 12:28pm

Request Review

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Fixes the delegation confirmation dialog showing the “stake migrated” copy for normal delegations by ensuring the recorded transaction args reflect what was submitted (not what the input contains after the form is reset).

Changes:

  • Capture a snapshot of bondWithHint call args at submission time in Delegate.tsx.
  • Pass the submitted snapshot to useHandleTransaction, falling back to live args prior to the first submission.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@coderabbitai

coderabbitai Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@rickstaa, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 42 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 4fa075d4-a706-467f-b7a1-84f1411986eb

📥 Commits

Reviewing files that changed from the base of the PR and between 6f2a4a1 and 9d601c3.

📒 Files selected for processing (1)
  • components/DelegatingWidget/Delegate.tsx
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/delegate-confirmation-amount

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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.

fix: delegation confirmation reports a stake migration

2 participants