Skip to content

Add validation to the Send form (address and amount) #490

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

Open
wants to merge 10 commits into
base: qt6
Choose a base branch
from

Conversation

johnny9
Copy link
Collaborator

@johnny9 johnny9 commented Aug 1, 2025

These changes add properties for the error strings used in the QML to SendRecipient and add validation methods that are checked when the relevant properties are changed by the user.

image

This is a port of #462 into the qt6 branch

@johnny9
Copy link
Collaborator Author

johnny9 commented Aug 5, 2025

@MarnixCroes do you mind re-reviewing this change?

Copy link
Contributor

@MarnixCroes MarnixCroes left a comment

Choose a reason for hiding this comment

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

55fdce2

  • The Amount must be greater than zero while there is only the placeholder text is a bit silly.
    Which can be repro'd by entering 0 and then deleting it.
image
  • The amount sometimes changes and gets negative when entering large numbers:
image
Screencast.from.2025-08-06.11-11-16.webm
Screencast.from.2025-08-06.11-13-03.webm

} else if (IsValidDestinationString(m_address.toStdString(), *CChainParams::TestNet())) {
setAddressError(tr("Address is valid for testnet, not the current network"));
} else {
setAddressError(tr("Invalid address format"));
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
setAddressError(tr("Invalid address format"));
setAddressError(tr("Invalid address"));

maybe better?

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.

2 participants