Skip to content

Commit 9854fd3

Browse files
committed
Remove deprecated address validators
1 parent ea47d7a commit 9854fd3

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
@@ -103,8 +103,6 @@ lazy_static = "1.4"
103103
env_logger = "0.7"
104104
electrsd = "0.20"
105105

106-
[[example]]
107-
name = "address_validator"
108106
[[example]]
109107
name = "compact_filters_balance"
110108
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
@@ -181,7 +179,6 @@ macro_rules! impl_error {
181179
}
182180

183181
impl_error!(descriptor::error::Error, Descriptor);
184-
impl_error!(address_validator::AddressValidatorError, AddressValidator);
185182
impl_error!(descriptor::policy::PolicyError, InvalidPolicyPathError);
186183
impl_error!(wallet::signer::SignerError, Signer);
187184

src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,6 @@ pub use descriptor::template;
273273
pub use descriptor::HdKeyPaths;
274274
pub use error::Error;
275275
pub use types::*;
276-
pub use wallet::address_validator;
277276
pub use wallet::signer;
278277
pub use wallet::signer::SignOptions;
279278
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
@@ -37,7 +37,6 @@ use miniscript::ToPublicKey;
3737
#[allow(unused_imports)]
3838
use log::{debug, error, info, trace};
3939

40-
pub mod address_validator;
4140
pub mod coin_selection;
4241
pub mod export;
4342
pub mod signer;
@@ -54,8 +53,6 @@ pub mod hardwaresigner;
5453

5554
pub use utils::IsDust;
5655

57-
#[allow(deprecated)]
58-
use address_validator::AddressValidator;
5956
use coin_selection::DefaultCoinSelectionAlgorithm;
6057
use signer::{SignOptions, SignerOrdering, SignersContainer, TransactionSigner};
6158
use tx_builder::{BumpFee, CreateTx, FeePolicy, TxBuilder, TxParams};
@@ -100,9 +97,6 @@ pub struct Wallet<D> {
10097
signers: Arc<SignersContainer>,
10198
change_signers: Arc<SignersContainer>,
10299

103-
#[allow(deprecated)]
104-
address_validators: Vec<Arc<dyn AddressValidator>>,
105-
106100
network: Network,
107101

108102
database: RefCell<D>,
@@ -236,7 +230,6 @@ where
236230
change_descriptor,
237231
signers,
238232
change_signers,
239-
address_validators: Vec::new(),
240233
network,
241234
database: RefCell::new(database),
242235
secp,
@@ -552,24 +545,6 @@ where
552545
}
553546
}
554547

555-
/// Add an address validator
556-
///
557-
/// See [the `address_validator` module](address_validator) for an example.
558-
#[deprecated]
559-
#[allow(deprecated)]
560-
pub fn add_address_validator(&mut self, validator: Arc<dyn AddressValidator>) {
561-
self.address_validators.push(validator);
562-
}
563-
564-
/// Get the address validators
565-
///
566-
/// See [the `address_validator` module](address_validator).
567-
#[deprecated]
568-
#[allow(deprecated)]
569-
pub fn get_address_validators(&self) -> &[Arc<dyn AddressValidator>] {
570-
&self.address_validators
571-
}
572-
573548
/// Start building a transaction.
574549
///
575550
/// This returns a blank [`TxBuilder`] from which you can specify the parameters for the transaction.
@@ -1348,16 +1323,6 @@ where
13481323
self.cache_addresses(keychain, index, CACHE_ADDR_BATCH_SIZE)?;
13491324
}
13501325

1351-
let derived_descriptor = descriptor.as_derived(index, &self.secp);
1352-
1353-
let hd_keypaths = derived_descriptor.get_hd_keypaths(&self.secp);
1354-
let script = derived_descriptor.script_pubkey();
1355-
1356-
for validator in &self.address_validators {
1357-
#[allow(deprecated)]
1358-
validator.validate(keychain, &hd_keypaths, &script)?;
1359-
}
1360-
13611326
Ok(index)
13621327
}
13631328

0 commit comments

Comments
 (0)