From 02e7809d53df165bbf880212c09b0a1c9cdf58f1 Mon Sep 17 00:00:00 2001 From: Mykhailo Kremniov Date: Mon, 12 Jan 2026 11:53:00 +0200 Subject: [PATCH] Update deny.toml to ignore "RUSTSEC-2025-0141" (bincode no longer maintained); appease clippy 1.92 --- chainstate/db-dumper/src/dumper_lib/tests/mod.rs | 2 +- chainstate/launcher/src/config.rs | 10 +++------- chainstate/test-framework/src/random_tx_maker.rs | 4 ++-- common/src/address/dehexify.rs | 12 ++++++------ common/src/chain/transaction/output/mod.rs | 2 +- crypto/src/key/hdkd/child_number.rs | 6 +++--- deny.toml | 1 + mempool/src/pool/tests/orphans.rs | 2 +- node-gui/src/main.rs | 2 +- p2p/src/peer_manager/tests/connections.rs | 11 ++++++++--- p2p/src/peer_manager/tests/mod.rs | 11 ++++++++--- .../signer/tests/generic_fixed_signature_tests.rs | 2 +- .../wallet-cli-commands/src/command_handler/mod.rs | 2 +- 13 files changed, 37 insertions(+), 30 deletions(-) diff --git a/chainstate/db-dumper/src/dumper_lib/tests/mod.rs b/chainstate/db-dumper/src/dumper_lib/tests/mod.rs index 6e09d2fea..95f274324 100644 --- a/chainstate/db-dumper/src/dumper_lib/tests/mod.rs +++ b/chainstate/db-dumper/src/dumper_lib/tests/mod.rs @@ -58,7 +58,7 @@ fn dump_blocks_predefined() { let chain_config = Arc::new(chain::config::create_unit_test_config_builder().genesis_custom(genesis).build()); - let block_infos = vec![ + let block_infos = [ TestBlockInfo::from_input_info(TestBlockInputInfo { height: BlockHeight::new(1), is_mainchain: true, diff --git a/chainstate/launcher/src/config.rs b/chainstate/launcher/src/config.rs index 0fb8d244c..b295f2c15 100644 --- a/chainstate/launcher/src/config.rs +++ b/chainstate/launcher/src/config.rs @@ -19,16 +19,12 @@ use chainstate::ChainstateConfig; /// Storage type to use #[must_use] -#[derive(Debug, Clone, PartialEq, Eq)] +#[derive(Debug, Clone, PartialEq, Eq, Default)] pub enum StorageBackendConfig { + #[default] Lmdb, - InMemory, -} -impl Default for StorageBackendConfig { - fn default() -> Self { - Self::Lmdb - } + InMemory, } impl StorageBackendConfig { diff --git a/chainstate/test-framework/src/random_tx_maker.rs b/chainstate/test-framework/src/random_tx_maker.rs index 58e5cefb8..322f54f9f 100644 --- a/chainstate/test-framework/src/random_tx_maker.rs +++ b/chainstate/test-framework/src/random_tx_maker.rs @@ -1379,14 +1379,14 @@ impl<'a> RandomTxMaker<'a> { PrivateKey::new_from_rng(rng, KeyKind::Secp256k1Schnorr); *dummy_pool_id = pool_id; - *pool_data = Box::new(StakePoolData::new( + **pool_data = StakePoolData::new( pool_data.pledge(), Destination::PublicKey(staker_pk), vrf_pk, Destination::AnyoneCanSpend, pool_data.margin_ratio_per_thousand(), pool_data.cost_per_block(), - )); + ); let _ = pos_accounting_cache .create_pool(pool_id, pool_data.as_ref().clone().into()) .unwrap(); diff --git a/common/src/address/dehexify.rs b/common/src/address/dehexify.rs index a0885ae08..3012442ed 100644 --- a/common/src/address/dehexify.rs +++ b/common/src/address/dehexify.rs @@ -22,12 +22,12 @@ use super::hexified::HexifiedAddress; #[allow(clippy::let_and_return)] pub fn dehexify_all_addresses(conf: &ChainConfig, input: &str) -> String { - let result = HexifiedAddress::::replace_with_address(conf, input).to_string(); - let result = HexifiedAddress::::replace_with_address(conf, &result).to_string(); - let result = HexifiedAddress::::replace_with_address(conf, &result).to_string(); - let result = HexifiedAddress::::replace_with_address(conf, &result).to_string(); - let result = HexifiedAddress::::replace_with_address(conf, &result).to_string(); - let result = HexifiedAddress::::replace_with_address(conf, &result).to_string(); + let result = HexifiedAddress::::replace_with_address(conf, input).clone(); + let result = HexifiedAddress::::replace_with_address(conf, &result).clone(); + let result = HexifiedAddress::::replace_with_address(conf, &result).clone(); + let result = HexifiedAddress::::replace_with_address(conf, &result).clone(); + let result = HexifiedAddress::::replace_with_address(conf, &result).clone(); + let result = HexifiedAddress::::replace_with_address(conf, &result).clone(); result } diff --git a/common/src/chain/transaction/output/mod.rs b/common/src/chain/transaction/output/mod.rs index 28ecff103..2ea8bbb3e 100644 --- a/common/src/chain/transaction/output/mod.rs +++ b/common/src/chain/transaction/output/mod.rs @@ -279,7 +279,7 @@ impl TextSummary for TxOutput { NftIssuance::V0(iss1) => { let md = &iss1.metadata; let creator = match &md.creator { - Some(c) => hex::encode(c.public_key.encode()).to_string(), + Some(c) => hex::encode(c.public_key.encode()).clone(), None => "Unspecified".to_string(), }; format!( diff --git a/crypto/src/key/hdkd/child_number.rs b/crypto/src/key/hdkd/child_number.rs index 42311e022..5a96a81c7 100644 --- a/crypto/src/key/hdkd/child_number.rs +++ b/crypto/src/key/hdkd/child_number.rs @@ -145,9 +145,9 @@ mod test { #[case(0, false)] #[case(1, false)] #[case(1234567, false)] - #[case(u32::MAX & (!0x80000000 - 1), false)] - #[case(u32::MAX & !0x80000000, false)] - #[case(u32::MAX & (!0x80000000 + 1), true)] + #[case(!0x80000000 - 1, false)] + #[case(!0x80000000, false)] + #[case(!0x80000000 + 1, true)] #[case(u32::MAX - 1, true)] #[case(u32::MAX, true)] fn create_child_number(#[case] encoded_num: u32, #[case] is_hardened: bool) { diff --git a/deny.toml b/deny.toml index dd034f6d7..a2869ed63 100644 --- a/deny.toml +++ b/deny.toml @@ -48,4 +48,5 @@ db-urls = [ "https://github.com/RustSec/advisory-db" ] yanked = "warn" ignore = [ "RUSTSEC-2024-0436", # "paste" is no longer maintained + "RUSTSEC-2025-0141", # "bincode" is no longer maintained ] diff --git a/mempool/src/pool/tests/orphans.rs b/mempool/src/pool/tests/orphans.rs index b7902432d..83f9ee6ba 100644 --- a/mempool/src/pool/tests/orphans.rs +++ b/mempool/src/pool/tests/orphans.rs @@ -153,7 +153,7 @@ async fn diamond_graph(#[case] seed: Seed, #[case] insertion_plan: Vec<(usize, u let tx3 = make_tx(&mut rng, &[(tx1_outpt, 0), (tx2_outpt, 0)], &[90_000_000]); - let txs = vec![tx0, tx1, tx2, tx3]; + let txs = [tx0, tx1, tx2, tx3]; let tx_ids: Vec<_> = txs.iter().map(|tx| tx.transaction().get_id()).collect(); // Set up mempool and execute the insertion plan diff --git a/node-gui/src/main.rs b/node-gui/src/main.rs index e860f4315..fffddee4a 100644 --- a/node-gui/src/main.rs +++ b/node-gui/src/main.rs @@ -497,7 +497,7 @@ fn view(state: &GuiState) -> Element<'_, Message> { column![ iced::widget::text("Mintlayer-core node initialization failed".to_string()) .size(header_font_size), - iced::widget::text(message.to_string()).size(text_font_size) + iced::widget::text(message.clone()).size(text_font_size) ] } InitializationInterruptionReason::DataDirCleanedUp => { diff --git a/p2p/src/peer_manager/tests/connections.rs b/p2p/src/peer_manager/tests/connections.rs index 7a49ebab4..c6627886f 100644 --- a/p2p/src/peer_manager/tests/connections.rs +++ b/p2p/src/peer_manager/tests/connections.rs @@ -888,9 +888,14 @@ async fn connection_timeout_rpc_notified( ) .unwrap(); - logging::spawn_in_current_span(async move { - peer_manager.run().await.unwrap(); - }); + logging::spawn_in_current_span( + // Rust 1.92 thinks that the unwrap call here is unreachable, even though the function + // returns a normal error. + #[allow(unreachable_code)] + async move { + peer_manager.run().await.unwrap(); + }, + ); let (response_sender, response_receiver) = oneshot_nofail::channel(); peer_mgr_event_sender diff --git a/p2p/src/peer_manager/tests/mod.rs b/p2p/src/peer_manager/tests/mod.rs index d06812f24..5711f79a1 100644 --- a/p2p/src/peer_manager/tests/mod.rs +++ b/p2p/src/peer_manager/tests/mod.rs @@ -209,9 +209,14 @@ where { let (peer_manager, peer_mgr_event_sender, shutdown_sender, subscribers_sender) = make_peer_manager_custom::(transport, addr, chain_config, p2p_config, time_getter).await; - logging::spawn_in_current_span(async move { - peer_manager.run().await.unwrap(); - }); + logging::spawn_in_current_span( + // Rust 1.92 thinks that the unwrap call here is unreachable, even though the function + // returns a normal error. + #[allow(unreachable_code)] + async move { + peer_manager.run().await.unwrap(); + }, + ); (peer_mgr_event_sender, shutdown_sender, subscribers_sender) } diff --git a/wallet/src/signer/tests/generic_fixed_signature_tests.rs b/wallet/src/signer/tests/generic_fixed_signature_tests.rs index d2c278830..fa85a0818 100644 --- a/wallet/src/signer/tests/generic_fixed_signature_tests.rs +++ b/wallet/src/signer/tests/generic_fixed_signature_tests.rs @@ -531,7 +531,7 @@ pub async fn test_fixed_signatures_generic2( let account2_dest2 = new_dest_from_account(&mut account2, &mut db_tx, KeyPurpose::Change); let account2_pk2 = find_pub_key_for_pkh_dest(&account2_dest2, &account2).clone(); - let utxos = vec![ + let utxos = [ TxOutput::Transfer( OutputValue::Coin(Amount::from_atoms(1000)), account1_dest4.clone(), diff --git a/wallet/wallet-cli-commands/src/command_handler/mod.rs b/wallet/wallet-cli-commands/src/command_handler/mod.rs index f19c8a4a9..bf6e49d5f 100644 --- a/wallet/wallet-cli-commands/src/command_handler/mod.rs +++ b/wallet/wallet-cli-commands/src/command_handler/mod.rs @@ -1856,7 +1856,7 @@ where ) }) .collect(); - Ok(ConsoleCommand::Print(delegations.join("\n").to_string())) + Ok(ConsoleCommand::Print(delegations.join("\n").clone())) } WalletCommand::ListCreatedBlocksIds => {