Skip to content

Commit 9885494

Browse files
committed
upgrading bdk_wallet to version 2.1
1 parent 30ae85d commit 9885494

File tree

7 files changed

+41
-64
lines changed

7 files changed

+41
-64
lines changed

.github/workflows/cont_integration.yml

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ jobs:
1010
strategy:
1111
matrix:
1212
rust:
13-
- 1.87.0 # current
14-
- 1.63.0 # MSRV
13+
- 1.89.0 # current
14+
- 1.75.0 # MSRV
1515
steps:
1616
- name: checkout
1717
uses: actions/checkout@v4
@@ -36,19 +36,12 @@ jobs:
3636
- name: Update Cargo.lock
3737
run: cargo update
3838
- name: Pin dependencies for MSRV
39-
if: matrix.rust == '1.63.0'
39+
if: matrix.rust == '1.75.0'
4040
run: |
41-
cargo update -p zstd-sys --precise "2.0.8+zstd.1.5.5"
42-
cargo update -p time --precise "0.3.20"
43-
cargo update -p home --precise "0.5.5"
44-
cargo update -p flate2 --precise "1.0.35"
45-
cargo update -p bzip2-sys --precise "0.1.12"
46-
cargo update -p ring --precise "0.17.12"
47-
cargo update -p once_cell --precise "1.20.3"
48-
cargo update -p base64ct --precise "1.6.0"
49-
cargo update -p minreq --precise "2.13.2"
50-
cargo update -p bdk_electrum --precise 0.20.1
51-
cargo update -p rustls:0.23.28 --precise 0.23.12
41+
cargo update -p base64ct --precise "1.7.3"
42+
cargo update -p home --precise "0.5.9"
43+
cargo update -p deranged --precise "0.4.0"
44+
cargo update -p minreq --precise "2.13.2"
5245
- name: Build
5346
run: cargo build
5447
- name: Clippy

Cargo.toml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "bdk-reserves"
3-
version = "1.2.0"
3+
version = "2.1.0"
44
authors = ["Richard Ulrich <[email protected]>"]
55
edition = "2018"
66
description = "Proof of reserves for bitcoin dev kit"
@@ -10,7 +10,7 @@ license = "MIT OR Apache-2.0"
1010
repository = "https://github.com/bitcoindevkit/bdk-reserves"
1111

1212
[dependencies]
13-
bdk_wallet = { version = "1.2.0", default-features = false, features = ["std"] }
13+
bdk_wallet = { version = "2.1.0", default-features = false, features = ["std"] }
1414
bitcoinconsensus = "0.19.0-3"
1515
log = "^0.4"
1616

@@ -19,6 +19,6 @@ units = { package = "bitcoin-units", version = "0.1.0", default-features = false
1919

2020
[dev-dependencies]
2121
rstest = "^0.11"
22-
bdk_wallet = { version = "1.0.0", default-features = true, features = ["test-utils"] }
23-
bdk_electrum = "0.20.1"
24-
electrsd = { version = "0.29", features = ["bitcoind_22_1", "electrs_0_9_1"] }
22+
bdk_wallet = { version = "2.1.0", default-features = true, features = ["test-utils"] }
23+
bdk_electrum = "0.23.1"
24+
electrsd = { version = "0.34", features = ["corepc-node_28_0", "electrs_0_10_6"] }

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM rust:1.87-bookworm
1+
FROM rust:1.89-trixie
22
ARG http_proxy
33
ENV http_proxy=$http_proxy
44
ENV https_proxy=$http_proxy

Dockerfile_63 renamed to Dockerfile_75

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM rust:1.63-buster
1+
FROM rust:1.75-bookworm
22
ARG http_proxy
33
ENV http_proxy=$http_proxy
44
ENV https_proxy=$http_proxy
@@ -16,6 +16,7 @@ RUN apt-get update \
1616
ca-certificates \
1717
clang \
1818
curl \
19+
emscripten \
1920
hunspell \
2021
libclang-dev \
2122
libssl-dev \

Makefile

Lines changed: 13 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,26 @@
11
TAG := bdk-reserves
2-
TAG_63 := bdk-reserves-63
3-
http_proxy ?= http://172.17.0.1:3128
2+
TAG_75 := bdk-reserves-75
3+
#http_proxy ?= http://172.17.0.1:3128
44
DOCKER_RUN := docker run --interactive --rm \
55
-v ${PWD}:/home/satoshi \
66

77
build: builder
88
$(DOCKER_RUN) --tty ${TAG} cargo build
99

10-
test: test_current test_63
10+
test: test_current test_75
1111

1212
test_current: builder
1313
rm -f Cargo.lock
1414
$(DOCKER_RUN) ${TAG} cargo test
1515

16-
test_63: builder_63
16+
test_75: builder_75
1717
rm -f Cargo.lock
18-
$(DOCKER_RUN) ${TAG_63} cargo test || true
19-
$(DOCKER_RUN) ${TAG_63} cargo update -p zstd-sys --precise "2.0.8+zstd.1.5.5" || true
20-
$(DOCKER_RUN) ${TAG_63} cargo update -p time --precise "0.3.20" || true
21-
$(DOCKER_RUN) ${TAG_63} cargo update -p home --precise "0.5.5" || true
22-
$(DOCKER_RUN) ${TAG_63} cargo update -p flate2 --precise "1.0.35" || true
23-
$(DOCKER_RUN) ${TAG_63} cargo update -p bzip2-sys --precise "0.1.12" || true
24-
$(DOCKER_RUN) ${TAG_63} cargo update -p ring --precise "0.17.12" || true
25-
$(DOCKER_RUN) ${TAG_63} cargo update -p once_cell --precise "1.20.3" || true
26-
$(DOCKER_RUN) ${TAG_63} cargo update -p base64ct --precise "1.6.0" || true
27-
$(DOCKER_RUN) ${TAG_63} cargo update -p minreq --precise "2.13.2" || true
28-
$(DOCKER_RUN) ${TAG_63} cargo update -p bdk_electrum --precise 0.20.1 || true
29-
$(DOCKER_RUN) ${TAG_63} cargo update -p rustls:0.23.28 --precise 0.23.12 || true
30-
$(DOCKER_RUN) ${TAG_63} cargo test
18+
$(DOCKER_RUN) ${TAG_75} cargo test || true
19+
$(DOCKER_RUN) ${TAG_75} cargo update -p base64ct --precise "1.7.3" || true
20+
$(DOCKER_RUN) ${TAG_75} cargo update -p home --precise "0.5.9" || true
21+
$(DOCKER_RUN) ${TAG_75} cargo update -p deranged --precise "0.4.0" || true
22+
$(DOCKER_RUN) ${TAG_75} cargo update -p minreq --precise "2.13.2" || true
23+
$(DOCKER_RUN) ${TAG_75} cargo test
3124

3225
run: builder
3326
$(DOCKER_RUN) --tty ${TAG} cargo run
@@ -50,10 +43,10 @@ builder:
5043
--build-arg UID="$(shell id -u)" \
5144
.
5245

53-
builder_63:
54-
docker build --tag ${TAG_63}\
46+
builder_75:
47+
docker build --tag ${TAG_75}\
5548
--build-arg http_proxy="${http_proxy}" \
5649
--build-arg UID="$(shell id -u)" \
57-
-f Dockerfile_63 \
50+
-f Dockerfile_75 \
5851
.
5952

README.md

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -50,22 +50,15 @@ at your option.
5050

5151
## Minimum Supported Rust Version (MSRV)
5252

53-
This library should always compile with Rust **1.63.0**.
53+
This library should always compile with Rust **1.75.0**.
5454

5555
To build with the MSRV you will need to pin the below dependencies:
5656

5757
```shell
58-
cargo update -p zstd-sys --precise "2.0.8+zstd.1.5.5"
59-
cargo update -p time --precise "0.3.20"
60-
cargo update -p home --precise "0.5.5"
61-
cargo update -p flate2 --precise "1.0.35"
62-
cargo update -p bzip2-sys --precise "0.1.12"
63-
cargo update -p ring --precise "0.17.12"
64-
cargo update -p once_cell --precise "1.20.3"
65-
cargo update -p base64ct --precise "1.6.0"
58+
cargo update -p base64ct --precise "1.7.3"
59+
cargo update -p home --precise "0.5.9"
60+
cargo update -p deranged --precise "0.4.0"
6661
cargo update -p minreq --precise "2.13.2"
67-
cargo update -p bdk_electrum --precise 0.20.1
68-
cargo update -p rustls:0.23.28 --precise 0.23.12
6962
```
7063

7164
## Contribution

tests/regtestenv.rs

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,8 @@ use bdk_electrum::electrum_client::Client;
22
use bdk_electrum::{electrum_client, BdkElectrumClient};
33
use bdk_wallet::bitcoin::{Amount, FeeRate};
44
use bdk_wallet::{KeychainKind, SignOptions, Wallet};
5-
use electrsd::bitcoind::bitcoincore_rpc::{
6-
bitcoin::{Address, Network},
7-
RpcApi,
8-
};
9-
use electrsd::bitcoind::BitcoinD;
5+
use electrsd::corepc_node::client::bitcoin::{Address, Network};
6+
use electrsd::corepc_node::Node;
107
use electrsd::electrum_client::ElectrumApi;
118
use electrsd::ElectrsD;
129
use std::str::FromStr;
@@ -15,20 +12,20 @@ use std::time::Duration;
1512
/// The environment to run a single test, while many of them can run in parallel.
1613
pub struct RegTestEnv {
1714
/// Instance of the bitcoin core daemon
18-
bitcoind: BitcoinD,
15+
bitcoind: Node,
1916
/// Instance of the electrs electrum server
2017
electrsd: ElectrsD,
2118
}
2219

2320
impl RegTestEnv {
2421
/// set up local bitcoind and electrs instances in regtest mode
2522
pub fn new() -> Self {
26-
let mut bitcoind_conf = electrsd::bitcoind::Conf::default();
27-
bitcoind_conf.p2p = electrsd::bitcoind::P2P::Yes;
23+
let mut bitcoind_conf = electrsd::corepc_node::Conf::default();
24+
bitcoind_conf.p2p = electrsd::corepc_node::P2P::Yes;
2825

29-
let bitcoind_exe = electrsd::bitcoind::downloaded_exe_path()
26+
let bitcoind_exe = electrsd::corepc_node::downloaded_exe_path()
3027
.expect("We should always have downloaded path");
31-
let bitcoind = BitcoinD::with_conf(bitcoind_exe, &bitcoind_conf).unwrap();
28+
let bitcoind = Node::with_conf(bitcoind_exe, &bitcoind_conf).unwrap();
3229

3330
let mut elect_conf = electrsd::Conf::default();
3431
elect_conf.view_stderr = false; // setting this to true will lead to very verbose logging
@@ -116,7 +113,7 @@ impl RegTestEnv {
116113

117114
self.bitcoind
118115
.client
119-
.generate_to_address(blocks as u64, address)
116+
.generate_to_address(blocks, address)
120117
.unwrap();
121118

122119
let header = loop {
@@ -127,7 +124,7 @@ impl RegTestEnv {
127124
}
128125
};
129126

130-
assert_eq!(header.height, old_height + blocks);
127+
assert!(header.height >= old_height + blocks, "{} >= {}", header.height, old_height + blocks);
131128
}
132129
}
133130

0 commit comments

Comments
 (0)