mirror of
https://github.com/bitcoin-core/gui-qml.git
synced 2026-12-02 08:12:38 +00:00
qml: Validate wallet name during wallet creation #686
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!686
Loading…
Reference in a new issue
No description provided.
Delete branch "duplicate-wallet-name"
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?
Fixes https://github.com/bitcoin-core/gui-qml/issues/571
When creating a wallet, the name is checked for
The same checks are performed for external-signer wallets.
Review notes
This PR is stacked on top of #547.Now rebased on top ofqt6Screenshots
I could've written unit test, but the scaffolding for test_walletcontroller is all in #551 already.
Felt it's easier to add later rather than picking that commit and dropping it later when #551 is merged. Thoughts @johnny9 ?
I'm fine with that.
558cf9c1b722adbbf294a6c9901a3cc0d57caadd
Rebased on top of
qt6now558cf9c1b722adbbf294a6c9901a3cc0d57caadd
tested a bit, works as expected ✅
IMO this makes sense.
Note that bitcoin-qt, allows special characters, more than 20 characters and does not trim.
IDK if this was a purposeful decision (back then).
nit
in bitcoin-qt and bitcoin core wallet names are not distinct from paths, so whatever characters are permitted in a path are permitted in a wallet name..
This validation rule disallows wallet names that use utf-8 I am not sure if that's intentional?
I wonder if wallet name rules belong to the wallet itself rather than the gui controller. Related is that users with existing wallets that violate these rules won't be able to load them in the gui.
validation rules in the gui can give faster feedback to the user so they are useful but the current validation rules are too restrictive. it shouldn't prevent the user from loading their 🚀🚀🚀🚀🚀🚀 wallet but we should allow utf-8 wallet names since it is valid
Agree. I'll relax the regex to allow utf-8.
Additionally, David suggested moving the wallet name validation to wallet and exposing a wallet interface for it. (as a follow-up, not required for this PR)
here's an interesting nit I noticed, should I placeholder test represent valid names, as in should the placeholder test instead be: "my_bitcoin_wallet"
Hi @GBKS - is there a design spec to show validation errors? Would it be toast?
Pulled this into https://github.com/bitcoin-core/gui-qml/pull/727. Closing this PR.