From dbf215637524412be09b7ada28a4ddb3a2e4b97a Mon Sep 17 00:00:00 2001 From: Steve Myers Date: Thu, 17 Feb 2022 09:18:58 -0800 Subject: [PATCH 1/8] [ci] Update build-test to use latest stable and 1.49.0 MSRV --- .github/workflows/cont_integration.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cont_integration.yml b/.github/workflows/cont_integration.yml index bab633ddf..67e880d41 100644 --- a/.github/workflows/cont_integration.yml +++ b/.github/workflows/cont_integration.yml @@ -10,9 +10,9 @@ jobs: strategy: matrix: rust: - - version: 1.56.0 # STABLE + - version: stable # STABLE clippy: true - - version: 1.46.0 # MSRV + - version: 1.49.0 # MSRV features: - default - minimal From ef1e19ec16ed6e20d43f0f87033561da4869d71f Mon Sep 17 00:00:00 2001 From: Steve Myers Date: Thu, 17 Feb 2022 09:19:53 -0800 Subject: [PATCH 2/8] Add MSRV policy statement to README --- README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/README.md b/README.md index d9491400f..22f58d8d5 100644 --- a/README.md +++ b/README.md @@ -170,6 +170,16 @@ cargo test --features test-electrum The other options are `test-esplora` or `test-rpc`. Note that `electrs` and `bitcoind` binaries are automatically downloaded (on mac and linux), to specify you already have installed binaries you must use `--no-default-features` and provide `BITCOIND_EXE` and `ELECTRS_EXE` as environment variables. +## Supported Rust Versions + +The BDK MSRV (minimum supported rust version) will be as low as possible to support required +dependencies and no higher than the [rustc](https://tracker.debian.org/pkg/rustc) version packaged +with the Debian ["testing"] release, and if possible the ["stable"] release. We will only increase +the BDK MSRV with a new MINOR release, never a PATCH release. + +["testing"]: https://www.debian.org/releases/testing/ +["stable"]: https://www.debian.org/releases/stable/ + ## License Licensed under either of From b43aae3d3a6f0b6c485ea3e8a24f0aa35a2f3c1f Mon Sep 17 00:00:00 2001 From: Steve Myers Date: Thu, 17 Feb 2022 09:33:43 -0800 Subject: [PATCH 3/8] Allow clippy warning manual-split-once Not using `split_once` is a warning for `stable` but is not yet supported with our MSRV. https://rust-lang.github.io/rust-clippy/master/index.html#manual_split_once --- src/wallet/export.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/wallet/export.rs b/src/wallet/export.rs index e39d178ea..5c5e4075d 100644 --- a/src/wallet/export.rs +++ b/src/wallet/export.rs @@ -95,6 +95,7 @@ impl FromStr for WalletExport { } } +#[allow(clippy::manual_split_once)] fn remove_checksum(s: String) -> String { s.splitn(2, '#').next().map(String::from).unwrap() } From 7551e758cdd2c1b72ec0e998c84583517e4fcd1f Mon Sep 17 00:00:00 2001 From: Steve Myers Date: Thu, 17 Feb 2022 09:45:14 -0800 Subject: [PATCH 4/8] Remove Default impl for SignOptions, use derive Default Fixes clippy warning: https://rust-lang.github.io/rust-clippy/master/index.html#derivable_impls --- src/wallet/signer.rs | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/src/wallet/signer.rs b/src/wallet/signer.rs index 88b98461c..2feb5f1b1 100644 --- a/src/wallet/signer.rs +++ b/src/wallet/signer.rs @@ -448,7 +448,7 @@ impl SignersContainer { /// Options for a software signer /// /// Adjust the behavior of our software signers and the way a transaction is finalized -#[derive(Debug, Clone)] +#[derive(Debug, Clone, Default)] pub struct SignOptions { /// Whether the signer should trust the `witness_utxo`, if the `non_witness_utxo` hasn't been /// provided @@ -479,16 +479,6 @@ pub struct SignOptions { pub allow_all_sighashes: bool, } -impl Default for SignOptions { - fn default() -> Self { - SignOptions { - trust_witness_utxo: false, - assume_height: None, - allow_all_sighashes: false, - } - } -} - pub(crate) trait ComputeSighash { fn sighash( psbt: &psbt::PartiallySignedTransaction, From 412828f8b4050144cc1158c9d3c8235ea014d572 Mon Sep 17 00:00:00 2001 From: Steve Myers Date: Thu, 17 Feb 2022 09:56:10 -0800 Subject: [PATCH 5/8] Replace the closure with the function itself Fixes clippy error: https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure --- examples/compiler.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/compiler.rs b/examples/compiler.rs index 0af034cb7..dda73e31f 100644 --- a/examples/compiler.rs +++ b/examples/compiler.rs @@ -85,7 +85,7 @@ fn main() -> Result<(), Box> { let network = matches .value_of("network") - .map(|n| Network::from_str(n)) + .map(Network::from_str) .transpose() .unwrap() .unwrap_or(Network::Testnet); From 09405e7afff755a6f3f1766c7beb8326f87ada0a Mon Sep 17 00:00:00 2001 From: Steve Myers Date: Thu, 17 Feb 2022 10:09:17 -0800 Subject: [PATCH 6/8] Fix clippy warnings where "field is never read" --- src/blockchain/compact_filters/peer.rs | 4 ++-- src/blockchain/rpc.rs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/blockchain/compact_filters/peer.rs b/src/blockchain/compact_filters/peer.rs index f415d285e..87a960469 100644 --- a/src/blockchain/compact_filters/peer.rs +++ b/src/blockchain/compact_filters/peer.rs @@ -115,7 +115,7 @@ pub struct Peer { writer: Arc>, responses: Arc>, - reader_thread: thread::JoinHandle<()>, + _reader_thread: thread::JoinHandle<()>, connected: Arc>, mempool: Arc, @@ -228,7 +228,7 @@ impl Peer { Ok(Peer { writer, responses, - reader_thread, + _reader_thread: reader_thread, connected, mempool, version, diff --git a/src/blockchain/rpc.rs b/src/blockchain/rpc.rs index 5c9ee2dd7..96860d673 100644 --- a/src/blockchain/rpc.rs +++ b/src/blockchain/rpc.rs @@ -55,7 +55,7 @@ pub struct RpcBlockchain { /// Rpc client to the node, includes the wallet name client: Client, /// Network used - network: Network, + _network: Network, /// Blockchain capabilities, cached here at startup capabilities: HashSet, /// Skip this many blocks of the blockchain at the first rescan, if None the rescan is done from the genesis block @@ -405,7 +405,7 @@ impl ConfigurableBlockchain for RpcBlockchain { Ok(RpcBlockchain { client, - network, + _network: network, capabilities, _storage_address: storage_address, skip_blocks: config.skip_blocks, From 53ed3563531dd42020e9f665a17ec600875883d7 Mon Sep 17 00:00:00 2001 From: Steve Myers Date: Thu, 17 Feb 2022 10:18:31 -0800 Subject: [PATCH 7/8] Allow clippy warning large_enum_variant for AnyBlockchain See clippy warning: https://rust-lang.github.io/rust-clippy/master/index.html#large_enum_variant --- src/blockchain/any.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/blockchain/any.rs b/src/blockchain/any.rs index 8470959d5..d0f98532e 100644 --- a/src/blockchain/any.rs +++ b/src/blockchain/any.rs @@ -108,6 +108,7 @@ macro_rules! impl_inner_method { /// It allows switching backend at runtime /// /// See [this module](crate::blockchain::any)'s documentation for a usage example. +#[allow(clippy::large_enum_variant)] // TODO fix https://rust-lang.github.io/rust-clippy/master/index.html#large_enum_variant pub enum AnyBlockchain { #[cfg(feature = "electrum")] #[cfg_attr(docsrs, doc(cfg(feature = "electrum")))] From 7469bd97e66f6888eb1143f40d1d21683cb116f4 Mon Sep 17 00:00:00 2001 From: Steve Myers Date: Thu, 17 Feb 2022 10:40:47 -0800 Subject: [PATCH 8/8] Update CHANGELOG with MSRV change --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6f7dece9b..be7dfb1b0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +- Increase project MSRV from 1.46.0 to 1.49.0, see new policy in README + ## [v0.16.0] - [v0.15.0] - Disable `reqwest` default features.