refactor(wallet)!: Make Wallet require a change descriptor

All `Wallet` constructors are modified to require a change
descriptor, where previously it was optional. Additionally
we enforce uniqueness of the change descriptor to avoid
ambiguity when deriving scripts and ensure the wallet will
always have two distinct keystores.

Notable changes

* Add error DescriptorError::ExternalAndInternalAreTheSame
* Remove error CreateTxError::ChangePolicyDescriptor
* No longer rely on `map_keychain`
This commit is contained in:
valued mammal
2024-03-26 21:57:10 -04:00
parent 8eef350bd0
commit 9d954cf7d2
16 changed files with 393 additions and 341 deletions

View File

@@ -21,7 +21,7 @@ fn main() -> Result<(), anyhow::Error> {
let mut wallet = Wallet::new_or_load(
external_descriptor,
Some(internal_descriptor),
internal_descriptor,
db,
Network::Testnet,
)?;