Skip to content

feat: validate multisig thresholds and signer uniqueness - #932

Merged
llinsss merged 1 commit into
DogStark:mainfrom
Enemuo-debug:feature/validate-multisig-thresholds-and-signer-uniqueness
Aug 28, 2026
Merged

feat: validate multisig thresholds and signer uniqueness#932
llinsss merged 1 commit into
DogStark:mainfrom
Enemuo-debug:feature/validate-multisig-thresholds-and-signer-uniqueness

Conversation

@Enemuo-debug

Copy link
Copy Markdown
Contributor

Closes #861

Summary

This PR adds comprehensive validation for multisig threshold configuration and signer uniqueness to prevent account lockouts and authorization weaknesses.

Changes

New files:

  • src/utils/multisigValidation.ts — Extracted, reusable validation logic with typed error/warning results
  • src/utils/multisigValidation.test.ts — 37 unit tests covering all validation rules
  • src/components/Wallet/MultiSigSetup.test.tsx — 26 component tests for UI behavior

Modified:

  • src/components/Wallet/MultiSigSetup.tsx — Enhanced with inline validation, confirmation dialog, and accessibility improvements

What was missing (now fixed)

  1. Duplicate signer detection — Catches duplicate keys within new signers and vs existing on-chain signers
  2. Threshold vs total weight validation — Prevents configurations where thresholds exceed available weight (which would lock the account)
  3. Confirmation dialog — Shows the exact resulting configuration before signing, with risk warnings
  4. Inline validation UI — Replaces alert() with accessible inline error/warning panels
  5. Risky configuration warnings — Alerts when thresholds equal total weight (all signers must participate)
  6. Zero-weight signer warnings — Warns when a signer has weight 0

Acceptance criteria coverage

  • ✅ Automated tests characterize the validation behavior (37 unit + 26 component tests)
  • ✅ No weakening of TypeScript, lint, authorization, or error handling
  • ✅ Success, empty/loading, failure, and boundary cases covered
  • ✅ Existing tests pass, new regression coverage included
  • ✅ Keyboard accessible, mobile-responsive (no layout changes, existing patterns preserved)
  • ✅ No configuration/contract/security documentation changes needed (behavior is strictly additive)

- Extract validation logic into reusable multisigValidation.ts utility
- Add duplicate signer detection (within new signers and vs existing on-chain signers)
- Add threshold vs total weight validation to prevent locked accounts
- Add warnings for risky configurations (thresholds equal to total weight)
- Replace alert() with inline validation error/warning UI
- Add confirmation dialog showing exact resulting configuration before signing
- Add keyboard-accessible per-signer error messages with aria attributes
- Add comprehensive test suites: 37 validation unit tests + 26 component tests

Closes DogStark#861
@drips-wave

drips-wave Bot commented Aug 26, 2026

Copy link
Copy Markdown

@Enemuo-debug Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@llinsss
llinsss merged commit 2d22fbb into DogStark:main Aug 28, 2026
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.

[Frontend] Validate multisig thresholds and signer uniqueness

3 participants