Skip to content

Commit e92cada

Browse files
committed
Use #[allow(deprecated)] to silence new deprecation warnings
The `bdk_wallet` release 2.2 deprecated BDK's signer API in favor of using `bitcoin::psbt::sign`. As the best approach for switching to that API is currently not entirely clear, we intermittently allow for the use of the deprecated APIs to silence the warnings and unbreak our CI.
1 parent 5c09a31 commit e92cada

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

src/error.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ use bdk_chain::bitcoin::psbt::ExtractTxError as BdkExtractTxError;
1111
use bdk_chain::local_chain::CannotConnectError as BdkChainConnectionError;
1212
use bdk_chain::tx_graph::CalculateFeeError as BdkChainCalculateFeeError;
1313
use bdk_wallet::error::CreateTxError as BdkCreateTxError;
14+
#[allow(deprecated)]
1415
use bdk_wallet::signer::SignerError as BdkSignerError;
1516

1617
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
@@ -207,6 +208,7 @@ impl fmt::Display for Error {
207208

208209
impl std::error::Error for Error {}
209210

211+
#[allow(deprecated)]
210212
impl From<BdkSignerError> for Error {
211213
fn from(_: BdkSignerError) -> Self {
212214
Self::OnchainTxSigningFailed

src/wallet/mod.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ use std::str::FromStr;
1111
use std::sync::{Arc, Mutex};
1212

1313
use bdk_chain::spk_client::{FullScanRequest, SyncRequest};
14-
use bdk_wallet::{Balance, KeychainKind, PersistedWallet, SignOptions, Update};
14+
#[allow(deprecated)]
15+
use bdk_wallet::SignOptions;
16+
use bdk_wallet::{Balance, KeychainKind, PersistedWallet, Update};
1517
use bitcoin::address::NetworkUnchecked;
1618
use bitcoin::blockdata::constants::WITNESS_SCALE_FACTOR;
1719
use bitcoin::blockdata::locktime::absolute::LockTime;
@@ -222,6 +224,7 @@ impl Wallet {
222224
Ok(())
223225
}
224226

227+
#[allow(deprecated)]
225228
pub(crate) fn create_funding_transaction(
226229
&self, output_script: ScriptBuf, amount: Amount, confirmation_target: ConfirmationTarget,
227230
locktime: LockTime,
@@ -338,6 +341,7 @@ impl Wallet {
338341
.map_err(|_| Error::InvalidAddress)
339342
}
340343

344+
#[allow(deprecated)]
341345
pub(crate) fn send_to_address(
342346
&self, address: &bitcoin::Address, send_amount: OnchainSendAmount,
343347
fee_rate: Option<FeeRate>,
@@ -647,6 +651,7 @@ impl Wallet {
647651
Ok(utxos)
648652
}
649653

654+
#[allow(deprecated)]
650655
fn get_change_script_inner(&self) -> Result<ScriptBuf, ()> {
651656
let mut locked_wallet = self.inner.lock().unwrap();
652657
let mut locked_persister = self.persister.lock().unwrap();
@@ -659,6 +664,7 @@ impl Wallet {
659664
Ok(address_info.address.script_pubkey())
660665
}
661666

667+
#[allow(deprecated)]
662668
fn sign_psbt_inner(&self, mut psbt: Psbt) -> Result<Transaction, ()> {
663669
let locked_wallet = self.inner.lock().unwrap();
664670

0 commit comments

Comments
 (0)