Skip to content

chore(proxy): remove three write-only useState declarations#241

Merged
jinglescode merged 1 commit into
mainfrom
chore/remove-dead-proxy-state
May 10, 2026
Merged

chore(proxy): remove three write-only useState declarations#241
jinglescode merged 1 commit into
mainfrom
chore/remove-dead-proxy-state

Conversation

@jinglescode
Copy link
Copy Markdown
Member

Summary

ProxyControl had three state variables whose values were destructured away — only the setters were called. Each setter call triggered an empty re-render with nothing downstream reading the value.

State Setter called from Live signal that replaces it
setLocalLoading 6 paired sites alongside setSetupLoading / setSpendLoading setupLoading / spendLoading (already used in JSX)
setSelectedUtxos <UTxOSelector onSelectionChange> callback None — selection is purely visual; contract uses all UTxOs
setManualSelected same callback same

The UTxOSelector.onSelectionChange prop is required ((selectedUtxos, manualSelected) => void not optional), so the callback is preserved as a no-op with an inline comment explaining the visual-only intent. Changing the prop to optional would be a wider refactor across multiple callers (new-transaction/index.tsx, staking/StakingActions/stakingActionCard.tsx, governance/index.tsx) and is out of scope here.

Net diff: 4 insertions, 15 deletions. Zero behavior change.

Test plan

  • Open a wallet with a proxy contract — proxy section renders
  • Run "Initialize Setup" — setup loading spinner shows during async
  • Run "Confirm Setup" — same loading behavior
  • Run "Spend from Proxy" — spend loading spinner shows during async
  • Toggle UTxOs in the UTxOSelector — UI responds (visual-only)

🤖 Generated with Claude Code

ProxyControl had three state variables whose values were never read,
only their setters. Calling them produced empty re-renders.

- setLocalLoading: paralleled setSetupLoading and setSpendLoading; the
  read-side `setupLoading` and `spendLoading` are the live signals
- setSelectedUtxos / setManualSelected: stored values from the UTxO
  selector callback that nothing downstream consumed; the contract
  already uses all UTxOs from the multisig wallet (per existing
  comment), so the selection is purely visual

The UTxOSelector callback is preserved as a no-op (the prop is
required) with a comment explaining the visual-only intent.

Net -11 lines, zero behavior change.
@vercel
Copy link
Copy Markdown

vercel Bot commented May 10, 2026

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

Project Deployment Actions Updated (UTC)
multisig Ready Ready Preview, Comment May 10, 2026 8:57am

Request Review

@jinglescode jinglescode merged commit 2d8b5ef into main May 10, 2026
6 checks passed
@jinglescode jinglescode deleted the chore/remove-dead-proxy-state branch May 10, 2026 09:00
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.

1 participant