-
Notifications
You must be signed in to change notification settings - Fork 332
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
refactor(wallet)!: Replace new_or_load()
with load_with_descriptors()
#1512
refactor(wallet)!: Replace new_or_load()
with load_with_descriptors()
#1512
Conversation
c639329
to
91fd8d8
Compare
91fd8d8
to
fa2f2ab
Compare
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.
Some brief notes that I saw while skimming over.
Updated load_with_descriptors() requires a ChangeSet and descriptors, validates they match. If the given descriptors have private keys signers are added. Also rename load_from_changeset() to load() and remove no longer needed NewOrLoadError.
fa2f2ab
to
b978e16
Compare
let mut wallet = if let Some(changeset) = changeset { | ||
Wallet::load_with_descriptors(external_descriptor, internal_descriptor, changeset)? | ||
} else { | ||
Wallet::new(external_descriptor, internal_descriptor, Network::Testnet)? |
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.
For consistency should we have Signet
here?
Wallet::new(external_descriptor, internal_descriptor, Network::Testnet)? | |
Wallet::new(external_descriptor, internal_descriptor, Network::Signet)? |
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.
This is addressed already in #1442.
let mut wallet = if let Some(changeset) = changeset { | ||
Wallet::load_with_descriptors(&args.descriptor, &args.change_descriptor, changeset)? | ||
} else { | ||
Wallet::new(&args.descriptor, &args.change_descriptor, Network::Testnet)? |
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.
Wallet::new(&args.descriptor, &args.change_descriptor, Network::Testnet)? | |
Wallet::new(&args.descriptor, &args.change_descriptor, args.network)? |
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.
This is addressed already in #1442.
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's looking good, the API got much more intelligible to me.
Concept ACK
closing in favor of #1514 |
Description
Replace
Wallet::new_or_load()
withWallet::load_with_descriptors()
. UpdatedWallet::load_with_descriptors()
now requires aChangeSet
and descriptors, and validates they match, if the given descriptors have private keys it adds signers.Also rename
Wallet::load_from_changeset()
toWallet::load()
and remove no longer neededNewOrLoadError
.Notes to the reviewers
Based on discussion in #1500.
Changelog notice
Changed
Checklists
All Submissions:
cargo fmt
andcargo clippy
before committingNew Features: