Skip to content

Commit 04994e4

Browse files
committed
ci: bump MSRV to 1.63.0
Fix related clippy errors
1 parent 2a8c8c2 commit 04994e4

File tree

18 files changed

+100
-185
lines changed

18 files changed

+100
-185
lines changed

.github/workflows/cont_integration.yml

Lines changed: 21 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ jobs:
1818
strategy:
1919
matrix:
2020
rust:
21-
- version: 1.65.0 # STABLE
21+
- version: stable
2222
clippy: true
23-
- version: 1.57.0 # MSRV
23+
- version: 1.63.0 # MSRV
2424
features:
2525
- default
2626
- minimal
@@ -60,33 +60,17 @@ jobs:
6060
- name: Update toolchain
6161
run: rustup update
6262
- name: Pin dependencies for MSRV
63-
if: matrix.rust.version == '1.57.0'
63+
if: matrix.rust.version == '1.63.0'
6464
run: |
65-
cargo update -p log --precise "0.4.18"
66-
cargo update -p tempfile --precise "3.6.0"
67-
cargo update -p hashlink --precise "0.8.1"
6865
cargo update -p regex --precise "1.7.3"
69-
cargo update -p zip:0.6.6 --precise "0.6.3"
70-
cargo update -p rustix --precise "0.37.23"
71-
cargo update -p tokio --precise "1.29.1"
72-
cargo update -p tokio-util --precise "0.7.8"
73-
cargo update -p cc --precise "1.0.81"
74-
cargo update -p rustls:0.20.9 --precise "0.20.8"
75-
cargo update -p rustls:0.21.7 --precise "0.21.1"
76-
cargo update -p flate2:1.0.27 --precise "1.0.26"
77-
cargo update -p reqwest --precise "0.11.18"
78-
cargo update -p h2 --precise "0.3.20"
79-
cargo update -p rustls-webpki:0.100.3 --precise "0.100.1"
80-
cargo update -p rustls-webpki:0.101.6 --precise "0.101.1"
81-
cargo update -p byteorder --precise "1.4.3"
82-
cargo update -p webpki --precise "0.22.2"
66+
cargo update -p home --precise "0.5.5"
8367
- name: Build
84-
run: cargo build --features ${{ matrix.features }} --no-default-features
68+
run: cargo build --features bitcoin/std,miniscript/std,${{ matrix.features }} --no-default-features
8569
- name: Clippy
8670
if: ${{ matrix.rust.clippy }}
87-
run: cargo clippy --all-targets --features ${{ matrix.features }} --no-default-features -- -D warnings
71+
run: cargo clippy --all-targets --features bitcoin/std,miniscript/std,${{ matrix.features }} --no-default-features -- -D warnings
8872
- name: Test
89-
run: cargo test --features ${{ matrix.features }} --no-default-features
73+
run: cargo test --features bitcoin/std,miniscript/std,${{ matrix.features }} --no-default-features
9074

9175
test-readme-examples:
9276
name: Test README.md examples
@@ -109,7 +93,7 @@ jobs:
10993
- name: Update toolchain
11094
run: rustup update
11195
- name: Test
112-
run: cargo test --features test-md-docs --no-default-features -- doctest::ReadmeDoctests
96+
run: cargo test --features bitcoin/std,miniscript/std,test-md-docs --no-default-features -- doctest::ReadmeDoctests
11397

11498
test-blockchains:
11599
name: Blockchain ${{ matrix.blockchain.features }}
@@ -120,19 +104,19 @@ jobs:
120104
blockchain:
121105
- name: electrum
122106
testprefix: blockchain::electrum::test
123-
features: test-electrum,verify
107+
features: test-electrum,verify,bitcoin/std,miniscript/std
124108
- name: rpc
125109
testprefix: blockchain::rpc::test
126-
features: test-rpc
110+
features: test-rpc,bitcoin/std,miniscript/std
127111
- name: rpc-legacy
128112
testprefix: blockchain::rpc::test
129-
features: test-rpc-legacy
113+
features: test-rpc-legacy,bitcoin/std,miniscript/std
130114
- name: esplora
131115
testprefix: esplora
132-
features: test-esplora,use-esplora-async,verify
116+
features: test-esplora,use-esplora-async,verify,bitcoin/std,miniscript/std
133117
- name: esplora
134118
testprefix: esplora
135-
features: test-esplora,use-esplora-blocking,verify
119+
features: test-esplora,use-esplora-blocking,verify,bitcoin/std,miniscript/std
136120
steps:
137121
- name: Checkout
138122
uses: actions/checkout@v2
@@ -150,7 +134,7 @@ jobs:
150134
toolchain: stable
151135
override: true
152136
- name: Test
153-
run: cargo test --no-default-features --features ${{ matrix.blockchain.features }} ${{ matrix.blockchain.testprefix }}::bdk_blockchain_tests
137+
run: cargo test --no-default-features --features bitcoin/std,miniscript/std,${{ matrix.blockchain.features }} ${{ matrix.blockchain.testprefix }}::bdk_blockchain_tests
154138

155139
check-wasm:
156140
name: Check WASM
@@ -175,15 +159,15 @@ jobs:
175159
- run: sudo apt-get update || exit 1
176160
- run: sudo apt-get install -y libclang-common-10-dev clang-10 libc6-dev-i386 || exit 1
177161
- name: Set default toolchain
178-
run: rustup default 1.65.0 # STABLE
162+
run: rustup default stable
179163
- name: Set profile
180164
run: rustup set profile minimal
181165
- name: Add target wasm32
182166
run: rustup target add wasm32-unknown-unknown
183167
- name: Update toolchain
184168
run: rustup update
185169
- name: Check
186-
run: cargo check --target wasm32-unknown-unknown --features async-interface,use-esplora-async,dev-getrandom-wasm --no-default-features
170+
run: cargo check --target wasm32-unknown-unknown --features bitcoin/no-std,miniscript/no-std,async-interface,use-esplora-async,dev-getrandom-wasm --no-default-features
187171

188172
fmt:
189173
name: Rust fmt
@@ -207,8 +191,8 @@ jobs:
207191
strategy:
208192
matrix:
209193
rust:
210-
- version: 1.65.0 # STABLE
211-
- version: 1.57.0 # MSRV
194+
- version: stable
195+
- version: 1.63.0 # MSRV
212196
steps:
213197
- name: Checkout
214198
uses: actions/checkout@v3
@@ -229,25 +213,9 @@ jobs:
229213
- name: Update toolchain
230214
run: rustup update
231215
- name: Pin dependencies for MSRV
232-
if: matrix.rust.version == '1.57.0'
216+
if: matrix.rust.version == '1.63.0'
233217
run: |
234-
cargo update -p log --precise "0.4.18"
235-
cargo update -p tempfile --precise "3.6.0"
236-
cargo update -p hashlink --precise "0.8.1"
237-
cargo update -p regex --precise "1.7.3"
238-
cargo update -p zip:0.6.6 --precise "0.6.3"
239-
cargo update -p rustix --precise "0.37.23"
240-
cargo update -p tokio --precise "1.29.1"
241-
cargo update -p tokio-util --precise "0.7.8"
242-
cargo update -p cc --precise "1.0.81"
243-
cargo update -p rustls:0.20.9 --precise "0.20.8"
244-
cargo update -p rustls:0.21.7 --precise "0.21.1"
245-
cargo update -p flate2:1.0.27 --precise "1.0.26"
246-
cargo update -p reqwest --precise "0.11.18"
247-
cargo update -p h2 --precise "0.3.20"
248-
cargo update -p rustls-webpki:0.100.3 --precise "0.100.1"
249-
cargo update -p rustls-webpki:0.101.6 --precise "0.101.1"
250-
cargo update -p byteorder --precise "1.4.3"
251-
cargo update -p webpki --precise "0.22.2"
218+
cargo update -p regex --precise "1.7.3"
219+
cargo update -p home --precise "0.5.5"
252220
- name: Test
253221
run: cargo test --features test-hardware-signer

Cargo.toml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
[package]
22
name = "bdk"
3-
version = "0.29.0"
4-
edition = "2018"
3+
version = "0.30.0"
54
authors = ["Alekos Filini <[email protected]>", "Riccardo Casatta <[email protected]>"]
65
homepage = "https://bitcoindevkit.org"
76
repository = "https://github.com/bitcoindevkit/bdk"
@@ -10,6 +9,8 @@ description = "A modern, lightweight, descriptor-based wallet library"
109
keywords = ["bitcoin", "wallet", "descriptor", "psbt"]
1110
readme = "README.md"
1211
license = "MIT OR Apache-2.0"
12+
edition = "2021"
13+
rust-version = "1.63"
1314

1415
[dependencies]
1516
bdk-macros = "^0.6"
@@ -24,11 +25,10 @@ rand = "^0.8"
2425
sled = { version = "0.34", optional = true }
2526
electrum-client = { version = "0.18", optional = true }
2627
esplora-client = { version = "0.6", default-features = false, optional = true }
27-
rusqlite = { version = "0.28.0", optional = true }
28-
ahash = { version = "0.7.6", optional = true }
28+
rusqlite = { version = "0.27.0", optional = true }
2929
futures = { version = "0.3", optional = true }
3030
async-trait = { version = "0.1", optional = true }
31-
rocksdb = { version = "0.14", default-features = false, features = ["snappy"], optional = true }
31+
rocksdb = { version = "0.18", default-features = false, features = ["snappy"], optional = true }
3232
cc = { version = ">=1.0.64", optional = true }
3333
socks = { version = "0.3", optional = true }
3434
hwi = { version = "0.7", optional = true, features = ["miniscript"] }
@@ -56,7 +56,7 @@ default = ["std", "key-value-db", "electrum"]
5656
# std feature is always required unless building for wasm32-unknown-unknown target
5757
# if building for wasm user must add dependencies bitcoin/no-std,miniscript/no-std
5858
std = ["bitcoin/std", "miniscript/std"]
59-
sqlite = ["rusqlite", "ahash"]
59+
sqlite = ["rusqlite"]
6060
sqlite-bundled = ["sqlite", "rusqlite/bundled"]
6161
compact_filters = ["rocksdb", "socks", "cc"]
6262
key-value-db = ["sled"]

README.md

Lines changed: 3 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<a href="https://github.com/bitcoindevkit/bdk/actions?query=workflow%3ACI"><img alt="CI Status" src="https://github.com/bitcoindevkit/bdk/workflows/CI/badge.svg"></a>
1414
<a href="https://coveralls.io/github/bitcoindevkit/bdk?branch=master"><img src="https://coveralls.io/repos/github/bitcoindevkit/bdk/badge.svg?branch=master"/></a>
1515
<a href="https://docs.rs/bdk"><img alt="API Docs" src="https://img.shields.io/badge/docs.rs-bdk-green"/></a>
16-
<a href="https://blog.rust-lang.org/2021/12/02/Rust-1.57.0.html"><img alt="Rustc Version 1.57.0+" src="https://img.shields.io/badge/rustc-1.57.0%2B-lightgrey.svg"/></a>
16+
<a href="https://blog.rust-lang.org/2022/08/11/Rust-1.63.0.html"><img alt="Rustc Version 1.63.0+" src="https://img.shields.io/badge/rustc-1.63.0%2B-lightgrey.svg"/></a>
1717
<a href="https://discord.gg/d7NkDKm"><img alt="Chat on Discord" src="https://img.shields.io/discord/753336465005608961?logo=discord"></a>
1818
</p>
1919

@@ -204,45 +204,11 @@ dual licensed as above, without any additional terms or conditions.
204204

205205
## Minimum Supported Rust Version (MSRV)
206206

207-
This library should compile with any combination of features with Rust 1.57.0.
207+
This library should compile with any combination of features with Rust 1.63.0.
208208

209209
To build with the MSRV you will need to pin dependencies as follows:
210210

211211
```shell
212-
# log 0.4.19 has MSRV 1.60.0
213-
cargo update -p log --precise "0.4.18"
214-
# tempfile 3.7.0 has MSRV 1.63.0
215-
cargo update -p tempfile --precise "3.6.0"
216-
# required for sqlite feature, hashlink 0.8.2 has MSRV 1.61.0
217-
cargo update -p hashlink --precise "0.8.1"
218-
# required for compact_filters feature, regex after 1.7.3 has MSRV 1.60.0
219212
cargo update -p regex --precise "1.7.3"
220-
# zip 0.6.3 has MSRV 1.59.0 but still works
221-
cargo update -p zip:0.6.6 --precise "0.6.3"
222-
# rustix 0.38.0 has MSRV 1.65.0
223-
cargo update -p rustix --precise "0.37.23"
224-
# tokio 1.30 has MSRV 1.63.0+
225-
cargo update -p tokio --precise "1.29.1"
226-
# tokio-util 0.7.9 doesn't build with MSRV 1.57.0
227-
cargo update -p tokio-util --precise "0.7.8"
228-
# cc 1.0.82 is throwing error with rust 1.57.0, "error[E0599]: no method named `retain_mut`..."
229-
cargo update -p cc --precise "1.0.81"
230-
# rustls 0.20.9 has MSRV 1.60.0+
231-
cargo update -p rustls:0.20.9 --precise "0.20.8"
232-
# rustls 0.21.2 has MSRV 1.60.0+
233-
cargo update -p rustls:0.21.7 --precise "0.21.1"
234-
# flate2 1.0.27 has MSRV 1.63.0+
235-
cargo update -p flate2:1.0.27 --precise "1.0.26"
236-
# reqwest 0.11.19 has MSRV 1.63.0+
237-
cargo update -p reqwest --precise "0.11.18"
238-
# h2 0.3.21 has MSRV 1.63.0+
239-
cargo update -p h2 --precise "0.3.20"
240-
# rustls-webpki 0.100.2 has MSRV 1.60+
241-
cargo update -p rustls-webpki:0.100.3 --precise "0.100.1"
242-
# rustls-webpki 0.101.6 has MSRV 1.60+
243-
cargo update -p rustls-webpki:0.101.6 --precise "0.101.1"
244-
# byteorder 1.5.0 has MSRV 1.60.0+
245-
cargo update -p byteorder --precise "1.4.3"
246-
# webpki 0.22.4 requires `ring:0.17.2` which has MSRV 1.61.0+
247-
cargo update -p webpki --precise "0.22.2"
213+
cargo update -p home --precise "0.5.5"
248214
```

clippy.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
msrv="1.63.0"

examples/compact_filters_balance.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ fn main() -> Result<(), CompactFiltersError> {
3434
let descriptor = "wpkh(tpubD6NzVbkrYhZ4X2yy78HWrr1M9NT8dKeWfzNiQqDdMqqa9UmmGztGGz6TaLFGsLfdft5iu32gxq1T4eMNxExNNWzVCpf9Y6JZi5TnqoC9wJq/*)";
3535

3636
let database = MemoryDatabase::default();
37-
let wallet = Arc::new(Wallet::new(descriptor, None, Network::Testnet, database).unwrap());
37+
let wallet = Wallet::new(descriptor, None, Network::Testnet, database).unwrap();
3838
wallet.sync(&blockchain, SyncOptions::default()).unwrap();
3939
info!("balance: {}", wallet.get_balance()?);
4040
Ok(())

src/blockchain/compact_filters/sync.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ impl CfSync {
166166
let filters = cf_filters
167167
.into_iter()
168168
.enumerate()
169-
.chain(filters_map.into_iter())
169+
.chain(filters_map)
170170
.collect();
171171
status = self
172172
.cf_store

src/blockchain/electrum.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ impl WalletSync for ElectrumBlockchain {
168168
let needs_block_height = conftime_req
169169
.request()
170170
.filter_map(|txid| txid_to_height.get(txid).cloned())
171-
.filter(|height| block_times.get(height).is_none())
171+
.filter(|height| block_times.contains_key(height))
172172
.take(chunk_size)
173173
.collect::<HashSet<u32>>();
174174

@@ -269,7 +269,7 @@ impl<'a, 'b, D: Database> TxCache<'a, 'b, D> {
269269
fn save_txs<'c>(&mut self, txids: impl Iterator<Item = &'c Txid>) -> Result<(), Error> {
270270
let mut need_fetch = vec![];
271271
for txid in txids {
272-
if self.cache.get(txid).is_some() {
272+
if self.cache.contains_key(txid) {
273273
continue;
274274
} else if let Some(transaction) = self.db.get_raw_tx(txid)? {
275275
self.cache.insert(*txid, transaction);
@@ -295,7 +295,7 @@ impl<'a, 'b, D: Database> TxCache<'a, 'b, D> {
295295
}
296296

297297
fn get(&self, txid: Txid) -> Option<Transaction> {
298-
self.cache.get(&txid).map(Clone::clone)
298+
self.cache.get(&txid).cloned()
299299
}
300300
}
301301

src/blockchain/script_sync.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,7 @@ impl<'a, D: BatchDatabase> State<'a, D> {
419419
txout: output.clone(),
420420
keychain,
421421
// Is this UTXO in the spent_utxos set?
422-
is_spent: spent_utxos.get(&outpoint).is_some(),
422+
is_spent: spent_utxos.contains(&outpoint),
423423
})?;
424424
}
425425
}
@@ -464,11 +464,10 @@ fn make_txs_consistent(txs: &[TransactionDetails]) -> Vec<&TransactionDetails> {
464464
}
465465

466466
utxo_index
467-
.into_iter()
468-
.map(|(_, tx)| (tx.txid, tx))
467+
.into_values()
468+
.map(|tx| (tx.txid, tx))
469469
.collect::<HashMap<_, _>>()
470-
.into_iter()
471-
.map(|(_, tx)| tx)
470+
.into_values()
472471
.chain(coinbase_txs)
473472
.collect()
474473
}

src/database/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,7 @@ pub(crate) trait DatabaseUtils: Database {
188188
.map(|o| o.is_some())
189189
}
190190

191+
#[allow(unused)]
191192
fn get_raw_tx_or<D>(&self, txid: &Txid, default: D) -> Result<Option<Transaction>, Error>
192193
where
193194
D: FnOnce() -> Result<Option<Transaction>, Error>,

0 commit comments

Comments
 (0)