Skip to content

Commit 47719f9

Browse files
committed
Update bdk dependency to 0.22
1 parent d4f078e commit 47719f9

File tree

5 files changed

+22
-11
lines changed

5 files changed

+22
-11
lines changed

Cargo.toml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "bdk-reserves"
3-
version = "0.20.0"
3+
version = "0.22.0"
44
authors = ["Richard Ulrich <richard.ulrich@seba.swiss>"]
55
edition = "2018"
66
description = "Proof of reserves for bitcoin dev kit"
@@ -9,12 +9,15 @@ readme = "README.md"
99
license = "MIT OR Apache-2.0"
1010
repository = "https://github.com/weareseba/bdk-reserves"
1111

12+
[patch.crates-io]
13+
bdk = { git = "https://github.com/bitcoindevkit/bdk", tag = "0.22.0-rc.1"}
14+
1215
[dependencies]
13-
bdk = { version = "0.20", default-features = false }
16+
bdk = { version = "0.22.0-rc.1", default-features = false }
1417
bitcoinconsensus = "0.19.0-3"
1518
log = "^0.4"
1619

1720
[dev-dependencies]
1821
rstest = "^0.11"
1922
bdk-testutils = "^0.4"
20-
bdk = { version = "0.20", default-features = true }
23+
bdk = { version = "0.22.0-rc.1", default-features = true }

tests/mempool.rs

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,11 @@ fn unconfirmed() -> Result<(), ProofError> {
2828
)?;
2929

3030
let balance = wallet.get_balance()?;
31-
assert!(balance > 10_000, "insufficient balance: {}", balance);
31+
assert!(
32+
balance.confirmed > 10_000,
33+
"insufficient balance: {}",
34+
balance.confirmed
35+
);
3236
let addr = wallet.get_address(AddressIndex::New).unwrap();
3337
assert_eq!(
3438
addr.to_string(),
@@ -58,7 +62,7 @@ fn unconfirmed() -> Result<(), ProofError> {
5862
assert!(finalized);
5963

6064
let spendable = wallet.verify_proof(&psbt, message, None)?;
61-
assert_eq!(spendable, new_balance);
65+
assert_eq!(spendable, new_balance.confirmed);
6266

6367
Ok(())
6468
}
@@ -73,7 +77,11 @@ fn confirmed() {
7377
.unwrap();
7478

7579
let balance = wallet.get_balance().unwrap();
76-
assert!(balance > 10_000, "insufficient balance: {}", balance);
80+
assert!(
81+
balance.confirmed > 10_000,
82+
"insufficient balance: {}",
83+
balance
84+
);
7785
let addr = wallet.get_address(AddressIndex::New).unwrap();
7886
assert_eq!(
7987
addr.to_string(),
@@ -109,5 +117,5 @@ fn confirmed() {
109117
let spendable = wallet
110118
.verify_proof(&psbt, message, Some(max_confirmation_height))
111119
.unwrap();
112-
assert_eq!(spendable, new_balance);
120+
assert_eq!(spendable, new_balance.confirmed);
113121
}

tests/multi_sig.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ fn test_proof_multisig(
9696
);
9797
let balance = wallet1.get_balance()?;
9898
assert!(
99-
(410000..=420000).contains(&balance),
99+
(410000..=420000).contains(&balance.confirmed),
100100
"balance is {} but should be between 410000 and 420000",
101101
balance
102102
);
@@ -158,7 +158,7 @@ fn test_proof_multisig(
158158
assert!(finalized);
159159

160160
let spendable = wallet1.verify_proof(&psbt, message, None)?;
161-
assert_eq!(spendable, balance);
161+
assert_eq!(spendable, balance.confirmed);
162162

163163
Ok(())
164164
}

tests/single_sig.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ fn test_proof(#[case] descriptor: &'static str) -> Result<(), ProofError> {
3636
assert!(finalized);
3737

3838
let spendable = wallet.verify_proof(&psbt, message, None)?;
39-
assert_eq!(spendable, balance);
39+
assert_eq!(spendable, balance.confirmed);
4040

4141
Ok(())
4242
}

tests/tampering.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ fn tampered_proof_message() {
2222
let spendable = wallet
2323
.verify_proof(&psbt_alice, message_alice, None)
2424
.unwrap();
25-
assert_eq!(spendable, balance);
25+
assert_eq!(spendable, balance.confirmed);
2626

2727
// change the message
2828
let message_bob = "This belongs to Bob.";

0 commit comments

Comments
 (0)