-
Notifications
You must be signed in to change notification settings - Fork 1
fix: address validation #625
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
…/address-validation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR implements balance validation for Bitcoin and Lightning invoice payments to address issue #354. The changes ensure users receive appropriate error messages when attempting to pay invoices with insufficient balance, invalid addresses, or network mismatches.
Changes:
- Added network validation logic to detect and reject addresses from incompatible Bitcoin networks (mainnet/testnet/regtest)
- Implemented balance validation for both on-chain and Lightning invoices with specific error messages showing the shortfall amount
- Added debounced address validation with immediate user feedback via toast messages
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| NetworkValidationHelper.kt | New utility class for detecting Bitcoin network from address prefixes and validating network compatibility |
| NetworkValidationHelperTest.kt | Comprehensive unit tests covering address network detection and mismatch validation scenarios |
| AppViewModel.kt | Integrated address validation with debouncing, balance checks, and user feedback for both input and scan flows |
| strings.xml | Added new error message string for insufficient spending balance on Lightning invoices |
Co-authored-by: Copilot <[email protected]>
|
@piotr-iohk needs an update from E2E |
Fixes #354
Description
This PR implement the balance validation of #354
Preview
zero-balance-scan-zero-amount-invoice.webm
zero-balance-sance-ln-amount-invoice.webm
invalid.webm
network-mismatch.webm
insufficient-savingsbalance-uniffied.webm
QA Notes