Bump bdk from 0.6.0 to 0.7.0

Bumps [bdk](https://github.com/bitcoindevkit/bdk) from 0.6.0 to 0.7.0.
- [Release notes](https://github.com/bitcoindevkit/bdk/releases)
- [Changelog](https://github.com/bitcoindevkit/bdk/blob/v0.7.0/CHANGELOG.md)
- [Commits](https://github.com/bitcoindevkit/bdk/compare/v0.6.0...v0.7.0)

Signed-off-by: dependabot[bot] <support@github.com>
This commit is contained in:
dependabot[bot] 2021-05-13 06:42:14 +00:00 committed by Thomas Eizinger
parent baf5a0896e
commit 6badf09394
No known key found for this signature in database
GPG Key ID: 651AC83A6C6C8B96
3 changed files with 14 additions and 7 deletions

4
Cargo.lock generated
View File

@ -237,9 +237,9 @@ checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd"
[[package]]
name = "bdk"
version = "0.6.0"
version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "51dcf686dfc6200d641e8619019c027976533b7e2d5c00de2b4182c88287a18b"
checksum = "d85959e6883d0286e39e89aa7791b2edc2b8712f0f7152fda43b692c4db96c06"
dependencies = [
"async-trait",
"bdk-macros",

View File

@ -15,7 +15,7 @@ async-trait = "0.1"
atty = "0.2"
backoff = { version = "0.3", features = [ "tokio" ] }
base64 = "0.13"
bdk = "0.6"
bdk = "0.7"
big-bytes = "1"
bitcoin = { version = "0.26", features = [ "rand", "use-serde" ] }
bmrng = "0.5"

View File

@ -10,7 +10,7 @@ use bdk::descriptor::Segwitv0;
use bdk::electrum_client::{ElectrumApi, GetHistoryRes};
use bdk::keys::DerivableKey;
use bdk::wallet::AddressIndex;
use bdk::{FeeRate, KeychainKind};
use bdk::{FeeRate, KeychainKind, SignOptions};
use bitcoin::{Network, Script};
use reqwest::Url;
use rust_decimal::prelude::*;
@ -246,14 +246,21 @@ where
C: EstimateFeeRate,
D: BatchDatabase,
{
pub async fn sign_and_finalize(&self, psbt: PartiallySignedTransaction) -> Result<Transaction> {
let (signed_psbt, finalized) = self.wallet.lock().await.sign(psbt, None)?;
pub async fn sign_and_finalize(
&self,
mut psbt: PartiallySignedTransaction,
) -> Result<Transaction> {
let finalized = self
.wallet
.lock()
.await
.sign(&mut psbt, SignOptions::default())?;
if !finalized {
bail!("PSBT is not finalized")
}
let tx = signed_psbt.extract_tx();
let tx = psbt.extract_tx();
Ok(tx)
}