-
Notifications
You must be signed in to change notification settings - Fork 261
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
Add the descriptor argument to createwallet #278
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. On L1154 is needed to add a check whether it is a descriptor wallet, as only legacy wallets have HD seeds. For example: There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It makes sense to add an assertion in test_create_wallet():
(It will be also required to add |
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.
I'm a bit confused about the goal of this line. You are setting
default_descriptors
to whatever its default value would be ... so why provide it at all?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.
It was easier to determine the default value than to use a variable number of arguments. Also there are more
createwallet
arguments in the newest version that are not added yet (load_on_startup
andexternal_signer
), and if they're added in the future, some value will need to be passed here anyway, right?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.
FWIW in theory, no, it's possible to use named arguments rather than positional ones, so that we don't have to stick values in just to get to further values. But that's a bigger change and unrelated to this PR :).
Okay, but simply dropping
default_descriptors
won't cause you to need a variable number of arguments. Right now you always pass it. I'm suggesting you never pass it.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.
@apoelstra if I don't include
default_descriptors
in the list of default arguments, the defaults would be applied incorrectly, right? At least if I understand the documentation ofhandle_defaults
correctly: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.
Handle defaults never touches the last argument anyway, so this will only become relevant if we add another argument here.
Also, on named arguments, my total refactor for async support migrates to using named arguments so we don't need the ugly
handle_defaults
stuff anymore.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.
To answer Andrew's concern:
He's only setting the default value that is filled if the actual value is not set.