bitcoindevkit / bdk-cli

A CLI wallet library and REPL tool to demo and test the BDK library
Other
108 stars 64 forks source link

if no wallet name was provided, use one derived from the descriptor #57

Closed ulrichard closed 2 years ago

ulrichard commented 2 years ago

Description

if no wallet name was provided, use one derived from the descriptor

Notes to the reviewers

Is there a better place to use wallet_name_from_descriptor so that the generated name shows up in the unit tests instead of the placeholder?

Checklists

All Submissions:

notmandatory commented 2 years ago

How about making WalletOpts.wallet an Option<String> ? Then you could avoid the "main_marker_will_be_replaced" default value and only do the replacement when WalletOpts.wallet is None; such as in the open_database function you can use unwrap_or to call your wallet_name_from_descriptor function.

ulrichard commented 2 years ago

@notmandatory Yes, of course. Sometimes the solution is so obvious that I have no clue why I didn't find it myself. Thanks.