Skip to content

fix(sdk-coin-vet): improve error messages for delegation/validator mutual exclusivity#8487

Closed
Gautam2305 wants to merge 1 commit intomasterfrom
fix/si-305-delegation-validator-error-messages
Closed

fix(sdk-coin-vet): improve error messages for delegation/validator mutual exclusivity#8487
Gautam2305 wants to merge 1 commit intomasterfrom
fix/si-305-delegation-validator-error-messages

Conversation

@Gautam2305
Copy link
Copy Markdown
Contributor

When a user attempts to delegate from a wallet with an active validator registration (or vice versa), the previous error message reported a raw address mismatch with no explanation of the underlying constraint.

This PR improves both validateStakingContractAddress and validateContractAddressForValidatorRegistration in utils.ts to detect cross-contract mismatches and surface a clear, human-readable error explaining that delegation and validator registration are mutually exclusive for a given wallet.

Ticket: SI-305

…tual exclusivity

When a user attempts to delegate from a wallet with an active validator
registration (or vice versa), the previous error message reported an
address mismatch without explaining the underlying constraint. The user
would see a cryptic message like "Invalid staking contract address.
Expected 0x03c... got 0x000..." with no indication of why.

The fix detects when the provided contract address belongs to the
opposing operation's contract, and surfaces a clear human-readable error
explaining that the two operations are mutually exclusive for a given
wallet. Generic address-mismatch errors are preserved for all other
invalid addresses.

Ticket: SI-305
@linear
Copy link
Copy Markdown

linear bot commented Apr 13, 2026

@Gautam2305 Gautam2305 closed this Apr 13, 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.

1 participant