And make Wallet Debug while I'm at it.
use bitcoin::util::bip32::Fingerprint;
use bitcoin::{Network, Script};
+#[derive(Debug)]
struct DummyValidator;
impl AddressValidator for DummyValidator {
fn validate(
//! # use bdk::address_validator::*;
//! # use bdk::database::*;
//! # use bdk::*;
+//! #[derive(Debug)]
//! struct PrintAddressAndContinue;
//!
//! impl AddressValidator for PrintAddressAndContinue {
/// validator will be propagated up to the original caller that triggered the address generation.
///
/// For a usage example see [this module](crate::address_validator)'s documentation.
-pub trait AddressValidator: Send + Sync {
+pub trait AddressValidator: Send + Sync + fmt::Debug {
/// Validate or inspect an address
fn validate(
&self,
use super::*;
use crate::wallet::test::{get_funded_wallet, get_test_wpkh};
+ #[derive(Debug)]
struct TestValidator;
impl AddressValidator for TestValidator {
fn validate(
/// A wallet can be either "online" if the [`blockchain`](crate::blockchain) type provided
/// implements [`Blockchain`], or "offline" if it is the unit type `()`. Offline wallets only expose
/// methods that don't need any interaction with the blockchain to work.
+#[derive(Debug)]
pub struct Wallet<B, D> {
descriptor: ExtendedDescriptor,
change_descriptor: Option<ExtendedDescriptor>,
/// [`build_fee_bump`]: Wallet::build_fee_bump
/// [`finish`]: Self::finish
/// [`coin_selection`]: Self::coin_selection
+#[derive(Clone, Debug)]
pub struct TxBuilder<'a, B, D, Cs, Ctx> {
pub(crate) wallet: &'a Wallet<B, D>,
// params and coin_selection are Options not becasue they are optionally set (they are always
/// The parameters for transaction creation sans coin selection algorithm.
//TODO: TxParams should eventually be exposed publicly.
-#[derive(Default, Debug)]
+#[derive(Default, Debug, Clone)]
pub(crate) struct TxParams {
pub(crate) recipients: Vec<(Script, u64)>,
pub(crate) drain_wallet: bool,
pub rate: f32,
}
-#[derive(Debug)]
+#[derive(Debug, Clone, Copy)]
pub(crate) enum FeePolicy {
FeeRate(FeeRate),
FeeAmount(u64),