Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion chainstate/db-dumper/src/dumper_lib/tests/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
10 changes: 3 additions & 7 deletions chainstate/launcher/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions chainstate/test-framework/src/random_tx_maker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
12 changes: 6 additions & 6 deletions common/src/address/dehexify.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::<Destination>::replace_with_address(conf, input).to_string();
let result = HexifiedAddress::<PoolId>::replace_with_address(conf, &result).to_string();
let result = HexifiedAddress::<DelegationId>::replace_with_address(conf, &result).to_string();
let result = HexifiedAddress::<TokenId>::replace_with_address(conf, &result).to_string();
let result = HexifiedAddress::<OrderId>::replace_with_address(conf, &result).to_string();
let result = HexifiedAddress::<VRFPublicKey>::replace_with_address(conf, &result).to_string();
let result = HexifiedAddress::<Destination>::replace_with_address(conf, input).clone();
let result = HexifiedAddress::<PoolId>::replace_with_address(conf, &result).clone();
let result = HexifiedAddress::<DelegationId>::replace_with_address(conf, &result).clone();
let result = HexifiedAddress::<TokenId>::replace_with_address(conf, &result).clone();
let result = HexifiedAddress::<OrderId>::replace_with_address(conf, &result).clone();
let result = HexifiedAddress::<VRFPublicKey>::replace_with_address(conf, &result).clone();

result
}
Expand Down
2 changes: 1 addition & 1 deletion common/src/chain/transaction/output/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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!(
Expand Down
6 changes: 3 additions & 3 deletions crypto/src/key/hdkd/child_number.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
1 change: 1 addition & 0 deletions deny.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
]
2 changes: 1 addition & 1 deletion mempool/src/pool/tests/orphans.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion node-gui/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 => {
Expand Down
11 changes: 8 additions & 3 deletions p2p/src/peer_manager/tests/connections.rs
Original file line number Diff line number Diff line change
Expand Up @@ -888,9 +888,14 @@ async fn connection_timeout_rpc_notified<T>(
)
.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
Expand Down
11 changes: 8 additions & 3 deletions p2p/src/peer_manager/tests/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -209,9 +209,14 @@ where
{
let (peer_manager, peer_mgr_event_sender, shutdown_sender, subscribers_sender) =
make_peer_manager_custom::<T>(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)
}

Expand Down
2 changes: 1 addition & 1 deletion wallet/src/signer/tests/generic_fixed_signature_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -531,7 +531,7 @@ pub async fn test_fixed_signatures_generic2<MkS, S>(
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(),
Expand Down
2 changes: 1 addition & 1 deletion wallet/wallet-cli-commands/src/command_handler/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1856,7 +1856,7 @@ where
)
})
.collect();
Ok(ConsoleCommand::Print(delegations.join("\n").to_string()))
Ok(ConsoleCommand::Print(delegations.join("\n").clone()))
}

WalletCommand::ListCreatedBlocksIds => {
Expand Down