Upgrade to bdk 0.10

This fixes #546. I don't know why, but I can't reproduce the problem
with the updated dependency.
pull/643/head
Thomas Eizinger 3 years ago
parent 475057abda
commit 0296509110
No known key found for this signature in database
GPG Key ID: 651AC83A6C6C8B96

@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
### Fixed
- An occasional error where users couldn't start a swap because of `InsufficientFunds` that were off by exactly 1 satoshi.
## [0.8.0] - 2021-07-09
### Added

19
Cargo.lock generated

@ -235,11 +235,20 @@ version = "0.13.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd"
[[package]]
name = "base64-compat"
version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5a8d4d2746f89841e49230dd26917df1876050f95abafafbe34f47cb534b88d7"
dependencies = [
"byteorder",
]
[[package]]
name = "bdk"
version = "0.8.0"
version = "0.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "05d7fee1aedf8935ba1e2c9aeee640d1b9754da1b64f30ad47e8b8e2b7904ec0"
checksum = "8f4da304c23a06c21807598a7fe3223566e84c76c6bba2cab2504370dd6f4938"
dependencies = [
"async-trait",
"bdk-macros",
@ -252,14 +261,13 @@ dependencies = [
"serde",
"serde_json",
"sled",
"tokio",
]
[[package]]
name = "bdk-macros"
version = "0.4.0"
version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b45570b78250774145859a8f85bfdb6e310663fc82640d7e159a44b1386074a2"
checksum = "c3f510015e946c5995cc169f7ed4c92ba032bbce795c0956ee0d98d82f7aff78"
dependencies = [
"proc-macro2 1.0.27",
"quote 1.0.9",
@ -331,6 +339,7 @@ version = "0.26.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6742ec672d3f12506f4ac5c0d853926ff1f94e675f60ffd3224039972bf663f1"
dependencies = [
"base64-compat",
"bech32",
"bitcoin_hashes",
"secp256k1",

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

@ -306,7 +306,8 @@ where
.iter()
.find(|tx| tx.txid == txid)
.context("Could not find tx in bdk wallet when trying to determine fees")?
.fees;
.fee
.expect("fees are always present with Electrum backend");
Ok(Amount::from_sat(fees))
}
@ -394,14 +395,16 @@ where
let mut tx_builder = wallet.build_tx();
let dummy_script = Script::from(vec![0u8; locking_script_size]);
tx_builder.set_single_recipient(dummy_script);
tx_builder.drain_wallet();
tx_builder.drain_to(dummy_script);
tx_builder.fee_rate(fee_rate);
let response = tx_builder.finish();
match response {
Ok((_, details)) => {
let max_giveable = details.sent - details.fees;
let max_giveable = details.sent
- details
.fee
.expect("fees are always present with Electrum backend");
Ok(Amount::from_sat(max_giveable))
}
Err(bdk::Error::InsufficientFunds { .. }) => Ok(Amount::ZERO),
@ -600,7 +603,7 @@ impl WalletBuilder {
pub fn build(self) -> Wallet<(), bdk::database::MemoryDatabase, StaticFeeRate> {
use bdk::database::MemoryDatabase;
use bdk::{LocalUtxo, TransactionDetails};
use bdk::{ConfirmationTime, LocalUtxo, TransactionDetails};
use bitcoin::OutPoint;
use testutils::testutils;

Loading…
Cancel
Save