mirror of
https://github.com/bitcoin-core/gui-qml.git
synced 2026-12-02 08:39:39 +00:00
Add validation to the Send form (address and amount) #462
No reviewers
Labels
No labels
Android
Bug
Build system
Design suggestion
Doc
Needs design review
Needs rebase
Stage
UX
Up for grabs
Upstream
Wallet
duplicate
enhancement
good first issue
question
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
bitcoin-core/gui-qml!462
Loading…
Reference in a new issue
No description provided.
Delete branch "send-validation"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This is built on top of https://github.com/bitcoin-core/gui-qml/pull/450 so when reviewing, its best to select just the new commits in the "Files changed" tab.
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.
avoid clearing and setting - it would evaluate qml bindings twice.
could remove this case for now as it allows removing the circular dependency?
Nice addition. A few notes:
Always a bit finicky these input fields.
1e81bb677cScreencast from 2025-06-02 13-12-13.webm
Screencast from 2025-06-02 13-14-41.webm
Good catch, I will split up the validation and formatting helpers so that validation can happen while editing and it will reformat once editing is finished.
bummer, must have introduced a bug with conversion. I will double check the sats to btc conversion.
I will look at what options there are to restrict the character limit
Thats interesting. I will double check. Could it be regtest/testnet/mainnet differences in format.
I can update the error string to include this
This is a precursor to what will end up being the rich formatting of the amount. If you are inputing BTC amounts it will add the satoshi trailing 0's
I will consider this.
ill take another look at this
I think this might be a good idea and I can just do this validation when creating the transaction in the wallet model
Update from 1e81bb6 to a5aba54
I think im going to leave the circular dependency in for now.and take another look when doing validation with multiple recipients
tested LGTM 3630bc28744b3a2b9f4521af6756c2c9254d15a9
Note that when entering full balance,
Reviewis highlighted but not clickable.As the GUI won't allow creating tx's with 0 fees, maybe
Reviewshould only be highlighted when amount < balanceLooking good.
Address input
Amount input
0.1rather than0.10000000.Balance: 0,00348200 ₿. Send max., whereSend maxis underlined and a button that inserts the full balance into the input field. I have this partially working in the prototype, but need to fix some logic. Gets a little tricky when we also have theInclude fee in amounttoggle and multiple recipients. Maybe something for a separate PR?This is a good one. I will add an issue to include this in my validation when I add proper fee estimation.
Update from 3630bc2 to 29e568c
29e568cc1dLGTM,
a few minor comments:
Amount exceeds balancewhile the entry is 0.This happens when you delete the full entry by selecting and deleting in full. Using backspace to get to zero works as it should.
I'm able to enter zero without the error.
The error was displayed the first time I entered 0, after that the error wasn't there anymore
I understand the intention, but I'm not sure if this hard coded value is a good idea.
the placeholderText should probably also be dependent on the unit.
i.e. makes no sense to display 0.0000000 when using sats.
maybe for follow up.
Closing for now.
Feel free to reopen this based on the new default branch.