From 2586e1eb9fbdf583460e25e80324251b0cf3f60c Mon Sep 17 00:00:00 2001 From: Github Action Date: Sun, 15 Dec 2024 01:15:04 +0000 Subject: [PATCH 1/6] ci: automated update to rustc 1.83.0 --- rust-version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rust-version b/rust-version index 71fae54fb..6b4de0a42 100644 --- a/rust-version +++ b/rust-version @@ -1 +1 @@ -1.82.0 +1.83.0 From 941bca0d405f86e748ea629a2e241bffa41108f8 Mon Sep 17 00:00:00 2001 From: Steve Myers Date: Sun, 15 Dec 2024 19:15:52 -0600 Subject: [PATCH 2/6] ci(clippy): fix new stricter needless_lifetime errors for rust 1.83 https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes https://github.com/rust-lang/rust-clippy/pull/13286 --- crates/chain/src/tx_data_traits.rs | 6 +++--- crates/chain/src/tx_graph.rs | 6 +++--- crates/chain/tests/test_local_chain.rs | 2 +- crates/core/src/spk_client.rs | 10 +++++----- crates/file_store/src/entry_iter.rs | 4 ++-- crates/testenv/src/lib.rs | 2 +- crates/wallet/src/descriptor/mod.rs | 4 +--- crates/wallet/src/wallet/persisted.rs | 2 +- crates/wallet/src/wallet/tx_builder.rs | 2 +- 9 files changed, 18 insertions(+), 20 deletions(-) diff --git a/crates/chain/src/tx_data_traits.rs b/crates/chain/src/tx_data_traits.rs index e39f975d9..74d1021f6 100644 --- a/crates/chain/src/tx_data_traits.rs +++ b/crates/chain/src/tx_data_traits.rs @@ -76,7 +76,7 @@ pub trait Anchor: core::fmt::Debug + Clone + Eq + PartialOrd + Ord + core::hash: } } -impl<'a, A: Anchor> Anchor for &'a A { +impl Anchor for &A { fn anchor_block(&self) -> BlockId { ::anchor_block(self) } @@ -112,13 +112,13 @@ pub struct TxPosInBlock<'b> { pub tx_pos: usize, } -impl<'b> From> for BlockId { +impl From> for BlockId { fn from(pos: TxPosInBlock) -> Self { pos.block_id } } -impl<'b> From> for ConfirmationBlockTime { +impl From> for ConfirmationBlockTime { fn from(pos: TxPosInBlock) -> Self { Self { block_id: pos.block_id, diff --git a/crates/chain/src/tx_graph.rs b/crates/chain/src/tx_graph.rs index 0207f242e..2d512cfea 100644 --- a/crates/chain/src/tx_graph.rs +++ b/crates/chain/src/tx_graph.rs @@ -183,7 +183,7 @@ pub struct TxNode<'a, T, A> { pub last_seen_unconfirmed: Option, } -impl<'a, T, A> Deref for TxNode<'a, T, A> { +impl Deref for TxNode<'_, T, A> { type Target = T; fn deref(&self) -> &Self::Target { @@ -1350,7 +1350,7 @@ where } } -impl<'g, A, F, O> Iterator for TxAncestors<'g, A, F, O> +impl Iterator for TxAncestors<'_, A, F, O> where F: FnMut(usize, Arc) -> Option, { @@ -1470,7 +1470,7 @@ where } } -impl<'g, A, F, O> Iterator for TxDescendants<'g, A, F, O> +impl Iterator for TxDescendants<'_, A, F, O> where F: FnMut(usize, Txid) -> Option, { diff --git a/crates/chain/tests/test_local_chain.rs b/crates/chain/tests/test_local_chain.rs index e8515c868..a0b8220ee 100644 --- a/crates/chain/tests/test_local_chain.rs +++ b/crates/chain/tests/test_local_chain.rs @@ -30,7 +30,7 @@ enum ExpectedResult<'a> { Err(CannotConnectError), } -impl<'a> TestLocalChain<'a> { +impl TestLocalChain<'_> { fn run(mut self) { let got_changeset = match self.chain.apply_update(self.update) { Ok(changeset) => changeset, diff --git a/crates/core/src/spk_client.rs b/crates/core/src/spk_client.rs index eee4a5371..a5ec813c9 100644 --- a/crates/core/src/spk_client.rs +++ b/crates/core/src/spk_client.rs @@ -21,7 +21,7 @@ pub enum SyncItem<'i, I> { OutPoint(OutPoint), } -impl<'i, I: core::fmt::Debug + core::any::Any> core::fmt::Display for SyncItem<'i, I> { +impl core::fmt::Display for SyncItem<'_, I> { fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { match self { SyncItem::Spk(i, spk) => { @@ -485,7 +485,7 @@ struct KeychainSpkIter<'r, K> { inspect: &'r mut Box>, } -impl<'r, K: Ord + Clone> Iterator for KeychainSpkIter<'r, K> { +impl Iterator for KeychainSpkIter<'_, K> { type Item = Indexed; fn next(&mut self) -> Option { @@ -511,7 +511,7 @@ impl<'r, I, Item> SyncIter<'r, I, Item> { impl<'r, I, Item> ExactSizeIterator for SyncIter<'r, I, Item> where SyncIter<'r, I, Item>: Iterator {} -impl<'r, I> Iterator for SyncIter<'r, I, ScriptBuf> { +impl Iterator for SyncIter<'_, I, ScriptBuf> { type Item = ScriptBuf; fn next(&mut self) -> Option { @@ -524,7 +524,7 @@ impl<'r, I> Iterator for SyncIter<'r, I, ScriptBuf> { } } -impl<'r, I> Iterator for SyncIter<'r, I, Txid> { +impl Iterator for SyncIter<'_, I, Txid> { type Item = Txid; fn next(&mut self) -> Option { @@ -537,7 +537,7 @@ impl<'r, I> Iterator for SyncIter<'r, I, Txid> { } } -impl<'r, I> Iterator for SyncIter<'r, I, OutPoint> { +impl Iterator for SyncIter<'_, I, OutPoint> { type Item = OutPoint; fn next(&mut self) -> Option { diff --git a/crates/file_store/src/entry_iter.rs b/crates/file_store/src/entry_iter.rs index 6be3fd034..ad34c77de 100644 --- a/crates/file_store/src/entry_iter.rs +++ b/crates/file_store/src/entry_iter.rs @@ -33,7 +33,7 @@ impl<'t, T> EntryIter<'t, T> { } } -impl<'t, T> Iterator for EntryIter<'t, T> +impl Iterator for EntryIter<'_, T> where T: serde::de::DeserializeOwned, { @@ -71,7 +71,7 @@ where } } -impl<'t, T> Drop for EntryIter<'t, T> { +impl Drop for EntryIter<'_, T> { fn drop(&mut self) { // This syncs the underlying file's offset with the buffer's position. This way, we // maintain the correct position to start the next read/write. diff --git a/crates/testenv/src/lib.rs b/crates/testenv/src/lib.rs index abf4cac43..2c0f15f64 100644 --- a/crates/testenv/src/lib.rs +++ b/crates/testenv/src/lib.rs @@ -39,7 +39,7 @@ pub struct Config<'a> { pub electrsd: electrsd::Conf<'a>, } -impl<'a> Default for Config<'a> { +impl Default for Config<'_> { /// Use the default configuration plus set `http_enabled = true` for [`electrsd::Conf`] /// which is required for testing `bdk_esplora`. fn default() -> Self { diff --git a/crates/wallet/src/descriptor/mod.rs b/crates/wallet/src/descriptor/mod.rs index c3dd95da8..1d3b375fc 100644 --- a/crates/wallet/src/descriptor/mod.rs +++ b/crates/wallet/src/descriptor/mod.rs @@ -145,9 +145,7 @@ impl IntoWalletDescriptor for (ExtendedDescriptor, KeyMap) { network: Network, } - impl<'s, 'd> miniscript::Translator - for Translator<'s, 'd> - { + impl miniscript::Translator for Translator<'_, '_> { fn pk(&mut self, pk: &DescriptorPublicKey) -> Result { let secp = &self.secp; diff --git a/crates/wallet/src/wallet/persisted.rs b/crates/wallet/src/wallet/persisted.rs index a8876e8e4..d07c72712 100644 --- a/crates/wallet/src/wallet/persisted.rs +++ b/crates/wallet/src/wallet/persisted.rs @@ -254,7 +254,7 @@ impl PersistedWallet

{ } #[cfg(feature = "rusqlite")] -impl<'c> WalletPersister for bdk_chain::rusqlite::Transaction<'c> { +impl WalletPersister for bdk_chain::rusqlite::Transaction<'_> { type Error = bdk_chain::rusqlite::Error; fn initialize(persister: &mut Self) -> Result { diff --git a/crates/wallet/src/wallet/tx_builder.rs b/crates/wallet/src/wallet/tx_builder.rs index 3eea1eb3a..868d51dfa 100644 --- a/crates/wallet/src/wallet/tx_builder.rs +++ b/crates/wallet/src/wallet/tx_builder.rs @@ -644,7 +644,7 @@ impl<'a, Cs> TxBuilder<'a, Cs> { } } -impl<'a, Cs: CoinSelectionAlgorithm> TxBuilder<'a, Cs> { +impl TxBuilder<'_, Cs> { /// Finish building the transaction. /// /// Uses the thread-local random number generator (rng). From 1d03db9ab37bfe623e16bc85f712d4a1db4c51ed Mon Sep 17 00:00:00 2001 From: Steve Myers Date: Sun, 15 Dec 2024 19:25:05 -0600 Subject: [PATCH 3/6] ci(clippy): fix new default warn empty_line_after_doc_comments for rust 1.83 https://rust-lang.github.io/rust-clippy/master/index.html#empty_line_after_doc_comments https://github.com/rust-lang/rust-clippy/pull/13091 --- crates/wallet/examples/compiler.rs | 1 - crates/wallet/examples/policy.rs | 1 - crates/wallet/src/keys/mod.rs | 2 +- 3 files changed, 1 insertion(+), 3 deletions(-) diff --git a/crates/wallet/examples/compiler.rs b/crates/wallet/examples/compiler.rs index d0922fa4e..bf43f3ded 100644 --- a/crates/wallet/examples/compiler.rs +++ b/crates/wallet/examples/compiler.rs @@ -30,7 +30,6 @@ use bdk_wallet::{KeychainKind, Wallet}; /// can be derived from the policy. /// /// This example demonstrates the interaction between a bdk wallet and miniscript policy. - #[allow(clippy::print_stdout)] fn main() -> Result<(), Box> { // We start with a miniscript policy string diff --git a/crates/wallet/examples/policy.rs b/crates/wallet/examples/policy.rs index e64d47b53..2b55a2ebf 100644 --- a/crates/wallet/examples/policy.rs +++ b/crates/wallet/examples/policy.rs @@ -25,7 +25,6 @@ use bdk_wallet::signer::SignersContainer; /// /// This example demos a Policy output for a 2of2 multisig between between 2 parties, where the wallet holds /// one of the Extend Private key. - #[allow(clippy::print_stdout)] fn main() -> Result<(), Box> { let secp = bitcoin::secp256k1::Secp256k1::new(); diff --git a/crates/wallet/src/keys/mod.rs b/crates/wallet/src/keys/mod.rs index d9c241ff0..f12bcb94d 100644 --- a/crates/wallet/src/keys/mod.rs +++ b/crates/wallet/src/keys/mod.rs @@ -982,7 +982,7 @@ impl fmt::Display for KeyError { impl std::error::Error for KeyError {} #[cfg(test)] -pub mod test { +mod test { use bitcoin::bip32; use super::*; From 173cc42d00748e95df889fd487b5bebf458109d6 Mon Sep 17 00:00:00 2001 From: Steve Myers Date: Sun, 15 Dec 2024 19:35:58 -0600 Subject: [PATCH 4/6] ci(clippy): fix updated ptr_arg check for rust 1.83 https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg https://github.com/rust-lang/rust-clippy/pull/13313 --- crates/wallet/src/wallet/coin_selection.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/wallet/src/wallet/coin_selection.rs b/crates/wallet/src/wallet/coin_selection.rs index a785c3b28..4429fae73 100644 --- a/crates/wallet/src/wallet/coin_selection.rs +++ b/crates/wallet/src/wallet/coin_selection.rs @@ -898,7 +898,7 @@ mod test { .collect() } - fn sum_random_utxos(mut rng: &mut StdRng, utxos: &mut Vec) -> Amount { + fn sum_random_utxos(mut rng: &mut StdRng, utxos: &mut [WeightedUtxo]) -> Amount { let utxos_picked_len = rng.gen_range(2..utxos.len() / 2); utxos.shuffle(&mut rng); utxos[..utxos_picked_len] From 1755480d3ca87c2bff98035adc008d2d6a570ccc Mon Sep 17 00:00:00 2001 From: Steve Myers Date: Sun, 15 Dec 2024 21:47:12 -0600 Subject: [PATCH 5/6] ci: use prepared rust-version instead of stable for all jobs --- .github/workflows/cont_integration.yml | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/.github/workflows/cont_integration.yml b/.github/workflows/cont_integration.yml index e9b41b688..658dcde8e 100644 --- a/.github/workflows/cont_integration.yml +++ b/.github/workflows/cont_integration.yml @@ -16,12 +16,13 @@ jobs: run: echo "rust_version=$(cat rust-version)" >> $GITHUB_OUTPUT build-test: + needs: prepare name: Build and test runs-on: ubuntu-latest strategy: matrix: rust: - - version: stable + - version: ${{ needs.prepare.outputs.rust_version }} clippy: true - version: 1.63.0 # MSRV features: @@ -60,6 +61,7 @@ jobs: run: cargo test --workspace --exclude 'example_*' ${{ matrix.features }} check-no-std: + needs: prepare name: Check no_std runs-on: ubuntu-latest steps: @@ -68,7 +70,7 @@ jobs: - name: Install Rust toolchain uses: actions-rs/toolchain@v1 with: - toolchain: stable + toolchain: ${{ needs.prepare.outputs.rust_version }} override: true profile: minimal # target: "thumbv6m-none-eabi" @@ -88,6 +90,7 @@ jobs: run: cargo check --no-default-features --features miniscript/no-std,bdk_chain/hashbrown check-wasm: + needs: prepare name: Check WASM runs-on: ubuntu-20.04 env: @@ -103,7 +106,7 @@ jobs: - name: Install Rust toolchain uses: actions-rs/toolchain@v1 with: - toolchain: stable + toolchain: ${{ needs.prepare.outputs.rust_version }} override: true profile: minimal target: "wasm32-unknown-unknown" @@ -117,6 +120,7 @@ jobs: run: cargo check --target wasm32-unknown-unknown --no-default-features --features miniscript/no-std,bdk_chain/hashbrown,async fmt: + needs: prepare name: Rust fmt runs-on: ubuntu-latest steps: @@ -125,7 +129,7 @@ jobs: - name: Install Rust toolchain uses: actions-rs/toolchain@v1 with: - toolchain: stable + toolchain: ${{ needs.prepare.outputs.rust_version }} override: true profile: minimal components: rustfmt @@ -153,6 +157,7 @@ jobs: args: --all-features --all-targets -- -D warnings build-examples: + needs: prepare name: Build & Test Examples runs-on: ubuntu-latest strategy: @@ -172,7 +177,7 @@ jobs: - name: Install Rust toolchain uses: actions-rs/toolchain@v1 with: - toolchain: stable + toolchain: ${{ needs.prepare.outputs.rust_version }} override: true profile: minimal - name: Rust Cache From 272ce227b40da4990821baee239f1a227d79e4d8 Mon Sep 17 00:00:00 2001 From: Steve Myers Date: Mon, 16 Dec 2024 20:12:27 -0600 Subject: [PATCH 6/6] ci: update build_docs job to use rust nightly --- .github/workflows/nightly_docs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/nightly_docs.yml b/.github/workflows/nightly_docs.yml index 0bbe49936..6e821c6d2 100644 --- a/.github/workflows/nightly_docs.yml +++ b/.github/workflows/nightly_docs.yml @@ -10,7 +10,7 @@ jobs: - name: Checkout sources uses: actions/checkout@v4 - name: Set default toolchain - run: rustup default nightly-2024-05-12 + run: rustup default nightly - name: Set profile run: rustup set profile minimal - name: Update toolchain