Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@ Cargo.lock

*.swp
.idea

# IDE
/.vscode
9 changes: 7 additions & 2 deletions src/database/memory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -555,6 +555,7 @@ macro_rules! doctest_wallet {
use $crate::bitcoin::Network;
use $crate::database::MemoryDatabase;
use $crate::testutils;

let descriptor = "wpkh(cVpPVruEDdmutPzisEsYvtST1usBR3ntr8pXSyt6D2YYqXRyPcFW)";
let descriptors = testutils!(@descriptors (descriptor) (descriptor));

Expand All @@ -567,13 +568,17 @@ macro_rules! doctest_wallet {
Some(100),
);

$crate::Wallet::new(
let wallet = $crate::Wallet::new(
&descriptors.0,
descriptors.1.as_ref(),
Network::Regtest,
db
)
.unwrap()
.unwrap();

wallet.ensure_addresses_cached(10).unwrap();

wallet
}}
}

Expand Down
4 changes: 2 additions & 2 deletions src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ pub enum Error {
Key(crate::keys::KeyError),
/// Descriptor checksum mismatch
ChecksumMismatch,
/// Spending policy is not compatible with this [`KeychainKind`](crate::types::KeychainKind)
SpendingPolicyRequired(crate::types::KeychainKind),
/// Spending policy is not compatible with this [`ExtendedDescriptor`](crate::descriptor::ExtendedDescriptor)
SpendingPolicyRequired(Box<crate::descriptor::ExtendedDescriptor>),
/// Error while extracting and manipulating policies
InvalidPolicyPathError(crate::descriptor::policy::PolicyError),
/// Signing error
Expand Down
4 changes: 2 additions & 2 deletions src/testutils/blockchain_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1328,8 +1328,8 @@ macro_rules! bdk_blockchain_tests {
let tx = {
let mut builder = wallet.build_tx();
builder.add_recipient(test_client.get_node_address(None).script_pubkey(), 25_000)
.policy_path(ext_path, KeychainKind::External)
.policy_path(int_path, KeychainKind::Internal);
.policy_path(ext_path, wallet.get_descriptor_for_keychain(KeychainKind::External))
.policy_path(int_path, wallet.get_descriptor_for_keychain(KeychainKind::Internal));
let (mut psbt, _details) = builder.finish().unwrap();
wallet.sign(&mut psbt, Default::default()).unwrap();
psbt.extract_tx()
Expand Down
Loading