chore: ♻ cargo fmt

This commit is contained in:
Steve Degosserie 2026-02-23 16:23:16 +01:00 committed by undercover-cactus
parent 4a7c7c493e
commit 7f0aa6803c
9 changed files with 95 additions and 91 deletions

View file

@ -427,76 +427,72 @@ pub fn run() -> sc_cli::Result<()> {
};
match config.network.network_backend {
sc_network::config::NetworkBackendType::Libp2p => {
match config.chain_spec {
ref spec if spec.is_mainnet() => {
service::new_full::<
datahaven_mainnet_runtime::Runtime,
datahaven_mainnet_runtime::RuntimeApi,
sc_network::NetworkWorker<_, _>,
>(
config, cli.eth, role_options, indexer_options, sealing_mode
)
.await
}
ref spec if spec.is_testnet() => {
service::new_full::<
datahaven_testnet_runtime::Runtime,
datahaven_testnet_runtime::RuntimeApi,
sc_network::NetworkWorker<_, _>,
>(
config, cli.eth, role_options, indexer_options, sealing_mode
)
.await
}
_ => {
service::new_full::<
datahaven_stagenet_runtime::Runtime,
datahaven_stagenet_runtime::RuntimeApi,
sc_network::NetworkWorker<_, _>,
>(
config, cli.eth, role_options, indexer_options, sealing_mode
)
.await
}
sc_network::config::NetworkBackendType::Libp2p => match config.chain_spec {
ref spec if spec.is_mainnet() => {
service::new_full::<
datahaven_mainnet_runtime::Runtime,
datahaven_mainnet_runtime::RuntimeApi,
sc_network::NetworkWorker<_, _>,
>(
config, cli.eth, role_options, indexer_options, sealing_mode
)
.await
}
.map_err(sc_cli::Error::Service)
}
sc_network::config::NetworkBackendType::Litep2p => {
match config.chain_spec {
ref spec if spec.is_mainnet() => {
service::new_full::<
datahaven_mainnet_runtime::Runtime,
datahaven_mainnet_runtime::RuntimeApi,
sc_network::Litep2pNetworkBackend,
>(
config, cli.eth, role_options, indexer_options, sealing_mode
)
.await
}
ref spec if spec.is_testnet() => {
service::new_full::<
datahaven_testnet_runtime::Runtime,
datahaven_testnet_runtime::RuntimeApi,
sc_network::Litep2pNetworkBackend,
>(
config, cli.eth, role_options, indexer_options, sealing_mode
)
.await
}
_ => {
service::new_full::<
datahaven_stagenet_runtime::Runtime,
datahaven_stagenet_runtime::RuntimeApi,
sc_network::Litep2pNetworkBackend,
>(
config, cli.eth, role_options, indexer_options, sealing_mode
)
.await
}
ref spec if spec.is_testnet() => {
service::new_full::<
datahaven_testnet_runtime::Runtime,
datahaven_testnet_runtime::RuntimeApi,
sc_network::NetworkWorker<_, _>,
>(
config, cli.eth, role_options, indexer_options, sealing_mode
)
.await
}
_ => {
service::new_full::<
datahaven_stagenet_runtime::Runtime,
datahaven_stagenet_runtime::RuntimeApi,
sc_network::NetworkWorker<_, _>,
>(
config, cli.eth, role_options, indexer_options, sealing_mode
)
.await
}
.map_err(sc_cli::Error::Service)
}
.map_err(sc_cli::Error::Service),
sc_network::config::NetworkBackendType::Litep2p => match config.chain_spec {
ref spec if spec.is_mainnet() => {
service::new_full::<
datahaven_mainnet_runtime::Runtime,
datahaven_mainnet_runtime::RuntimeApi,
sc_network::Litep2pNetworkBackend,
>(
config, cli.eth, role_options, indexer_options, sealing_mode
)
.await
}
ref spec if spec.is_testnet() => {
service::new_full::<
datahaven_testnet_runtime::Runtime,
datahaven_testnet_runtime::RuntimeApi,
sc_network::Litep2pNetworkBackend,
>(
config, cli.eth, role_options, indexer_options, sealing_mode
)
.await
}
_ => {
service::new_full::<
datahaven_stagenet_runtime::Runtime,
datahaven_stagenet_runtime::RuntimeApi,
sc_network::Litep2pNetworkBackend,
>(
config, cli.eth, role_options, indexer_options, sealing_mode
)
.await
}
}
.map_err(sc_cli::Error::Service),
}
})
}

View file

@ -4,9 +4,9 @@ use crate::{
decompress_sync_committee_bits, Config, CurrentSyncCommittee, Pallet as EthereumBeaconClient,
Update, ValidatorsRoot,
};
use alloc::vec::Vec;
use snowbridge_beacon_primitives::PublicKeyPrepared;
use sp_core::H256;
use alloc::vec::Vec;
pub fn participant_pubkeys<T: Config>(
update: &Update,

View file

@ -21,8 +21,8 @@ use crate::Pallet as OutboundQueue;
)]
mod benchmarks {
use super::*;
use alloc::vec;
use alloc::boxed::Box;
use alloc::vec;
use alloc::vec::Vec;
/// Build `Upgrade` message with `MaxMessagePayloadSize`, in the worst-case.

View file

@ -15,8 +15,8 @@ use xcm::prelude::*;
#[benchmarks]
mod benchmarks {
use super::*;
use alloc::vec::Vec;
use alloc::boxed::Box;
use alloc::vec::Vec;
#[benchmark]
fn upgrade() -> Result<(), BenchmarkError> {

View file

@ -21,6 +21,7 @@
use crate::common::*;
use codec::Encode;
use core::str::from_utf8;
use datahaven_mainnet_runtime::{
currency::{HAVE, KILOHAVE, SUPPLY_FACTOR},
governance::TracksInfo,
@ -37,7 +38,6 @@ use pallet_conviction_voting::{AccountVote, Conviction, Event as ConvictionVotin
use pallet_preimage::Event as PreimageEvent;
use pallet_referenda::TracksInfo as TracksInfoTrait;
use pallet_referenda::{Event as ReferendaEvent, ReferendumInfo};
use core::str::from_utf8;
/// Test tracks info configuration
#[test]
@ -49,9 +49,10 @@ fn tracks_info_configured_correctly() {
assert_eq!(tracks.len(), 6);
// Verify track IDs and names
let track_names: Vec<&str> = tracks.iter().map(|track| {
from_utf8(&track.info.name).unwrap().trim_end_matches('\0')
}).collect();
let track_names: Vec<&str> = tracks
.iter()
.map(|track| from_utf8(&track.info.name).unwrap().trim_end_matches('\0'))
.collect();
assert_eq!(
track_names,
vec![
@ -67,7 +68,10 @@ fn tracks_info_configured_correctly() {
// Verify root track has strictest requirements
assert_eq!(tracks[0].id, 0u16);
assert_eq!(tracks[0].info.max_deciding, 5);
assert_eq!(tracks[0].info.decision_deposit, 20 * KILOHAVE * SUPPLY_FACTOR); // 20 * KILO_HAVE
assert_eq!(
tracks[0].info.decision_deposit,
20 * KILOHAVE * SUPPLY_FACTOR
); // 20 * KILO_HAVE
// Verify general admin track
assert_eq!(tracks[2].id, 2u16);

View file

@ -78,9 +78,7 @@ impl Default for ProxyType {
Self::Any
}
}
use core::{
convert::{From, Into},
};
use core::convert::{From, Into};
use datahaven_runtime_common::{
deal_with_fees::{
DealWithEthereumBaseFees, DealWithEthereumPriorityFees, DealWithSubstrateFeesAndTip,

View file

@ -21,6 +21,7 @@
use crate::common::*;
use codec::Encode;
use core::str::from_utf8;
use datahaven_stagenet_runtime::{
currency::{HAVE, SUPPLY_FACTOR},
governance::TracksInfo,
@ -37,7 +38,6 @@ use pallet_conviction_voting::{AccountVote, Conviction, Event as ConvictionVotin
use pallet_preimage::Event as PreimageEvent;
use pallet_referenda::TracksInfo as TracksInfoTrait;
use pallet_referenda::{Event as ReferendaEvent, ReferendumInfo};
use core::str::from_utf8;
/// Test tracks info configuration
#[test]
@ -49,9 +49,10 @@ fn tracks_info_configured_correctly() {
assert_eq!(tracks.len(), 6);
// Verify track IDs and names
let track_names: Vec<&str> = tracks.iter().map(|track| {
from_utf8(&track.info.name).unwrap().trim_end_matches('\0')
}).collect();
let track_names: Vec<&str> = tracks
.iter()
.map(|track| from_utf8(&track.info.name).unwrap().trim_end_matches('\0'))
.collect();
assert_eq!(
track_names,
vec![
@ -67,7 +68,10 @@ fn tracks_info_configured_correctly() {
// Verify root track has strictest requirements
assert_eq!(tracks[0].id, 0u16);
assert_eq!(tracks[0].info.max_deciding, 5);
assert_eq!(tracks[0].info.decision_deposit, 100000 * HAVE * SUPPLY_FACTOR); // 100 * KILO_HAVE
assert_eq!(
tracks[0].info.decision_deposit,
100000 * HAVE * SUPPLY_FACTOR
); // 100 * KILO_HAVE
// Verify general admin track
assert_eq!(tracks[2].id, 2u16);

View file

@ -78,9 +78,7 @@ impl Default for ProxyType {
Self::Any
}
}
use core::{
convert::{From, Into},
};
use core::convert::{From, Into};
use datahaven_runtime_common::{
deal_with_fees::{
DealWithEthereumBaseFees, DealWithEthereumPriorityFees, DealWithSubstrateFeesAndTip,

View file

@ -21,6 +21,7 @@
use crate::common::*;
use codec::Encode;
use core::str::from_utf8;
use datahaven_testnet_runtime::{
currency::{HAVE, SUPPLY_FACTOR},
governance::TracksInfo,
@ -37,7 +38,6 @@ use pallet_conviction_voting::{AccountVote, Conviction, Event as ConvictionVotin
use pallet_preimage::Event as PreimageEvent;
use pallet_referenda::TracksInfo as TracksInfoTrait;
use pallet_referenda::{Event as ReferendaEvent, ReferendumInfo};
use core::str::from_utf8;
/// Test tracks info configuration
#[test]
@ -49,9 +49,10 @@ fn tracks_info_configured_correctly() {
assert_eq!(tracks.len(), 6);
// Verify track IDs and names
let track_names: Vec<&str> = tracks.iter().map(|track| {
from_utf8(&track.info.name).unwrap().trim_end_matches('\0')
}).collect();
let track_names: Vec<&str> = tracks
.iter()
.map(|track| from_utf8(&track.info.name).unwrap().trim_end_matches('\0'))
.collect();
assert_eq!(
track_names,
vec![
@ -67,7 +68,10 @@ fn tracks_info_configured_correctly() {
// Verify root track has strictest requirements
assert_eq!(tracks[0].id, 0u16);
assert_eq!(tracks[0].info.max_deciding, 5);
assert_eq!(tracks[0].info.decision_deposit, 100000 * HAVE * SUPPLY_FACTOR); // 100 * KILO_HAVE
assert_eq!(
tracks[0].info.decision_deposit,
100000 * HAVE * SUPPLY_FACTOR
); // 100 * KILO_HAVE
// Verify general admin track
assert_eq!(tracks[2].id, 2u16);