Skip to content

Commit e3b3ecc

Browse files
committed
Remove deprecated address validators
1 parent 24f6527 commit e3b3ecc

File tree

6 files changed

+1
-263
lines changed

6 files changed

+1
-263
lines changed

Cargo.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,6 @@ lazy_static = "1.4"
102102
env_logger = "0.7"
103103
electrsd = "0.21"
104104

105-
[[example]]
106-
name = "address_validator"
107105
[[example]]
108106
name = "compact_filters_balance"
109107
required-features = ["compact_filters"]

examples/address_validator.rs

Lines changed: 0 additions & 63 deletions
This file was deleted.

src/error.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
use std::fmt;
1313

1414
use crate::bitcoin::Network;
15-
use crate::{descriptor, wallet, wallet::address_validator};
15+
use crate::{descriptor, wallet};
1616
use bitcoin::{OutPoint, Txid};
1717

1818
/// Errors that can be thrown by the [`Wallet`](crate::wallet::Wallet)
@@ -99,8 +99,6 @@ pub enum Error {
9999

100100
/// Error related to the parsing and usage of descriptors
101101
Descriptor(crate::descriptor::error::Error),
102-
/// Error that can be returned to fail the validation of an address
103-
AddressValidator(crate::wallet::address_validator::AddressValidatorError),
104102
/// Encoding error
105103
Encode(bitcoin::consensus::encode::Error),
106104
/// Miniscript error
@@ -191,7 +189,6 @@ macro_rules! impl_error {
191189
}
192190

193191
impl_error!(descriptor::error::Error, Descriptor);
194-
impl_error!(address_validator::AddressValidatorError, AddressValidator);
195192
impl_error!(descriptor::policy::PolicyError, InvalidPolicyPathError);
196193
impl_error!(wallet::signer::SignerError, Signer);
197194

src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,6 @@ pub use descriptor::template;
271271
pub use descriptor::HdKeyPaths;
272272
pub use error::Error;
273273
pub use types::*;
274-
pub use wallet::address_validator;
275274
pub use wallet::signer;
276275
pub use wallet::signer::SignOptions;
277276
pub use wallet::tx_builder::TxBuilder;

src/wallet/address_validator.rs

Lines changed: 0 additions & 158 deletions
This file was deleted.

src/wallet/mod.rs

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ use miniscript::psbt::{PsbtExt, PsbtInputExt, PsbtInputSatisfier};
3535
#[allow(unused_imports)]
3636
use log::{debug, error, info, trace};
3737

38-
pub mod address_validator;
3938
pub mod coin_selection;
4039
pub mod export;
4140
pub mod signer;
@@ -52,8 +51,6 @@ pub mod hardwaresigner;
5251

5352
pub use utils::IsDust;
5453

55-
#[allow(deprecated)]
56-
use address_validator::AddressValidator;
5754
use coin_selection::DefaultCoinSelectionAlgorithm;
5855
use signer::{SignOptions, SignerOrdering, SignersContainer, TransactionSigner};
5956
use tx_builder::{BumpFee, CreateTx, FeePolicy, TxBuilder, TxParams};
@@ -96,9 +93,6 @@ pub struct Wallet<D> {
9693
signers: Arc<SignersContainer>,
9794
change_signers: Arc<SignersContainer>,
9895

99-
#[allow(deprecated)]
100-
address_validators: Vec<Arc<dyn AddressValidator>>,
101-
10296
network: Network,
10397

10498
database: RefCell<D>,
@@ -232,7 +226,6 @@ where
232226
change_descriptor,
233227
signers,
234228
change_signers,
235-
address_validators: Vec::new(),
236229
network,
237230
database: RefCell::new(database),
238231
secp,
@@ -548,24 +541,6 @@ where
548541
}
549542
}
550543

551-
/// Add an address validator
552-
///
553-
/// See [the `address_validator` module](address_validator) for an example.
554-
#[deprecated]
555-
#[allow(deprecated)]
556-
pub fn add_address_validator(&mut self, validator: Arc<dyn AddressValidator>) {
557-
self.address_validators.push(validator);
558-
}
559-
560-
/// Get the address validators
561-
///
562-
/// See [the `address_validator` module](address_validator).
563-
#[deprecated]
564-
#[allow(deprecated)]
565-
pub fn get_address_validators(&self) -> &[Arc<dyn AddressValidator>] {
566-
&self.address_validators
567-
}
568-
569544
/// Start building a transaction.
570545
///
571546
/// This returns a blank [`TxBuilder`] from which you can specify the parameters for the transaction.
@@ -1346,16 +1321,6 @@ where
13461321
self.cache_addresses(keychain, index, CACHE_ADDR_BATCH_SIZE)?;
13471322
}
13481323

1349-
// TODO: remove address validators entirely
1350-
//
1351-
// let derived_descriptor = descriptor.at_derivation_index(index);
1352-
// let hd_keypaths = derived_descriptor.get_hd_keypaths(&self.secp);
1353-
// let script = derived_descriptor.script_pubkey();
1354-
// for validator in &self.address_validators {
1355-
// #[allow(deprecated)]
1356-
// validator.validate(keychain, &hd_keypaths, &script)?;
1357-
// }
1358-
13591324
Ok(index)
13601325
}
13611326

0 commit comments

Comments
 (0)