Skip to content

Fix incorrect error message for invalid address#3136

Merged
johnnyluo merged 1 commit into
mainfrom
aminsato/3079_issue
Jan 20, 2026
Merged

Fix incorrect error message for invalid address#3136
johnnyluo merged 1 commit into
mainfrom
aminsato/3079_issue

Conversation

@aminsato
Copy link
Copy Markdown
Collaborator

@aminsato aminsato commented Jan 20, 2026

Description

Please include a summary of the change and which issue is fixed.

Fixes #3079

Which feature is affected?

  • Create vault ( Secure / Fast) - Please ensure you created a Secure vault & fast vault
  • Sending - Please attach a tx link here
  • Swap - Please attach a tx link for the swap here
  • New Chain / Chain related feature - Please attach tx link here

Checklist

  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works

Screenshots (if applicable):

Additional context

Summary by CodeRabbit

  • New Features
    • Added destination address validation in the Send flow. The application now verifies addresses are valid for the selected blockchain before processing transactions, preventing transaction failures due to invalid addresses.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jan 20, 2026

Walkthrough

Added destination address validation in the Send flow to verify addresses against the target chain before gas fee calculation. The validation occurs in two locations within the send path, throwing an InvalidTransactionDataException with a send_error_no_address message when an invalid address is detected.

Changes

Cohort / File(s) Summary
Send Flow Address Validation
app/src/main/java/com/vultisig/wallet/ui/models/send/SendFormViewModel.kt
Added destination address validation checks in two locations before gas fee handling. Validates address using chainAccountAddressRepository.isValid(chain, addressFieldState.text.toString()) and raises InvalidTransactionDataException with send_error_no_address message if invalid.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately reflects the main change: adding address validation to show proper error messages instead of misleading gas calculation errors.
Linked Issues check ✅ Passed The PR successfully implements the requirements from issue #3079 by adding address validation checks that display proper validation messages instead of 'Gas calculation failed' errors.
Out of Scope Changes check ✅ Passed All changes are directly related to fixing the invalid address validation error message issue described in the linked issue #3079.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch aminsato/3079_issue

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

@aminsato aminsato force-pushed the aminsato/3079_issue branch from 62feb8a to f1e2765 Compare January 20, 2026 08:04
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@app/src/main/java/com/vultisig/wallet/ui/models/send/SendFormViewModel.kt`:
- Around line 1067-1071: The pre-validation using
chainAccountAddressRepository.isValid in SendFormViewModel blocks ENS/alias
inputs before addressParserRepository.resolveName can run; change the logic in
the send flow to only check for blank input at this point (e.g., ensure
addressFieldState.text is not empty) and remove or skip the isValid(...) call
here, then perform full validation of the resolved address after calling
addressParserRepository.resolveName and before constructing the transaction (use
chainAccountAddressRepository.isValid on the resolved result). Adjust references
in SendFormViewModel to ensure resolution happens first and validation happens
on the resolved address.

Copy link
Copy Markdown
Contributor

@johnnyluo johnnyluo left a comment

Choose a reason for hiding this comment

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

LGTM

@johnnyluo johnnyluo merged commit abf9dd8 into main Jan 20, 2026
2 checks passed
@johnnyluo johnnyluo deleted the aminsato/3079_issue branch January 20, 2026 08:43
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.

[BUG] - Incorrect Error Message for Invalid Address in Send Module

2 participants