From 2563a140778c58903d5d6011d3904118374af28e Mon Sep 17 00:00:00 2001 From: Roznovjak Date: Wed, 18 Dec 2024 13:28:53 +0100 Subject: [PATCH] formatting --- integration-tests/src/kusama_test_net.rs | 12 +++++++-- node/src/command.rs | 7 +---- node/src/rpc.rs | 6 +---- node/src/service.rs | 2 +- .../xyk-liquidity-mining/src/tests/mock.rs | 8 +++--- runtime/basilisk/src/assets.rs | 26 ++++++++----------- 6 files changed, 28 insertions(+), 33 deletions(-) diff --git a/integration-tests/src/kusama_test_net.rs b/integration-tests/src/kusama_test_net.rs index faf3d0d2c9..c69507a009 100644 --- a/integration-tests/src/kusama_test_net.rs +++ b/integration-tests/src/kusama_test_net.rs @@ -172,7 +172,7 @@ pub mod rococo { use sp_authority_discovery::AuthorityId as AuthorityDiscoveryId; use sp_consensus_babe::AuthorityId as BabeId; use sp_consensus_beefy::ecdsa_crypto::AuthorityId as BeefyId; - use sp_core::{Pair, Public, sr25519}; + use sp_core::{sr25519, Pair, Public}; /// Helper function to generate a crypto pair from seed fn get_from_seed(seed: &str) -> ::Public { @@ -201,7 +201,15 @@ pub mod rococo { pub fn get_authority_keys_from_seed_no_beefy( seed: &str, - ) -> (AccountId, AccountId, BabeId, GrandpaId, ValidatorId, AssignmentId, AuthorityDiscoveryId) { + ) -> ( + AccountId, + AccountId, + BabeId, + GrandpaId, + ValidatorId, + AssignmentId, + AuthorityDiscoveryId, + ) { ( get_account_id_from_seed::(&format!("{}//stash", seed)), get_account_id_from_seed::(seed), diff --git a/node/src/command.rs b/node/src/command.rs index 13d110c76c..0e716ecada 100644 --- a/node/src/command.rs +++ b/node/src/command.rs @@ -376,12 +376,7 @@ impl CliConfiguration for RelayChainCli { self.base.base.prometheus_config(default_listen_port, chain_spec) } - fn init( - &self, - _support_url: &String, - _impl_version: &String, - _logger_hook: F, - ) -> Result<()> + fn init(&self, _support_url: &String, _impl_version: &String, _logger_hook: F) -> Result<()> where F: FnOnce(&mut sc_cli::LoggerBuilder), { diff --git a/node/src/rpc.rs b/node/src/rpc.rs index 6735d412a5..4187f94ff5 100644 --- a/node/src/rpc.rs +++ b/node/src/rpc.rs @@ -44,11 +44,7 @@ where use substrate_state_trie_migration_rpc::{StateMigration, StateMigrationApiServer}; let mut module = RpcExtension::new(()); - let FullDeps { - client, - pool, - backend, - } = deps; + let FullDeps { client, pool, backend } = deps; module.merge(System::new(client.clone(), pool).into_rpc())?; module.merge(TransactionPayment::new(client.clone()).into_rpc())?; diff --git a/node/src/service.rs b/node/src/service.rs index 29111fe470..7ccd4be30a 100644 --- a/node/src/service.rs +++ b/node/src/service.rs @@ -171,7 +171,7 @@ async fn start_node_impl( let params = new_partial(¶chain_config)?; let (block_import, mut telemetry, telemetry_worker_handle) = params.other; - + let prometheus_registry = parachain_config.prometheus_registry().cloned(); let net_config = sc_network::config::FullNetworkConfiguration::<_, _, sc_network::NetworkWorker>::new( ¶chain_config.network, diff --git a/pallets/xyk-liquidity-mining/src/tests/mock.rs b/pallets/xyk-liquidity-mining/src/tests/mock.rs index 7718b67da4..e73396bfab 100644 --- a/pallets/xyk-liquidity-mining/src/tests/mock.rs +++ b/pallets/xyk-liquidity-mining/src/tests/mock.rs @@ -540,10 +540,10 @@ impl hydradx_traits::liquidity_mining::Mutate f } fn update_global_farm( - _global_farm_id: GlobalFarmId, - _planned_yielding_periods: Self::Period, - _yield_per_period: Perquintill, - _min_deposit: Self::Balance + _global_farm_id: GlobalFarmId, + _planned_yielding_periods: Self::Period, + _yield_per_period: Perquintill, + _min_deposit: Self::Balance, ) -> Result<(), Self::Error> { Err(sp_runtime::DispatchError::Other("Not implemented")) } diff --git a/runtime/basilisk/src/assets.rs b/runtime/basilisk/src/assets.rs index 611a5d7a04..6256202aba 100644 --- a/runtime/basilisk/src/assets.rs +++ b/runtime/basilisk/src/assets.rs @@ -20,10 +20,9 @@ use crate::governance::origins::GeneralAdmin; use crate::system::NativeAssetId; use hydradx_traits::{ - AMM, AssetKind, - router::{inverse_route, AmmTradeWeights, PoolType, Trade}, - AssetPairAccountIdFor, LockedBalance, OnTradeHandler, OraclePeriod, Source, fee::{InspectTransactionFeeCurrency, SwappablePaymentAssetTrader}, + router::{inverse_route, AmmTradeWeights, PoolType, Trade}, + AssetKind, AssetPairAccountIdFor, LockedBalance, OnTradeHandler, OraclePeriod, Source, AMM, }; use pallet_currencies::fungibles::FungibleCurrencies; use pallet_currencies::BasicCurrencyAdapter; @@ -38,7 +37,9 @@ use primitives::constants::{ use frame_support::{ parameter_types, - sp_runtime::{ArithmeticError, DispatchError, DispatchResult, app_crypto::sp_core::crypto::UncheckedFrom, traits::Zero}, + sp_runtime::{ + app_crypto::sp_core::crypto::UncheckedFrom, traits::Zero, ArithmeticError, DispatchError, DispatchResult, + }, traits::{ AsEnsureOriginWithArg, Contains, Currency, Defensive, EitherOf, EnsureOrigin, Get, Imbalance, LockIdentifier, NeverEnsureOrigin, OnUnbalanced, @@ -47,7 +48,7 @@ use frame_support::{ }; use frame_system::{EnsureRoot, RawOrigin}; use orml_tokens::CurrencyAdapter; -use orml_traits::{MultiCurrency, currency::MutationHooks}; +use orml_traits::{currency::MutationHooks, MultiCurrency}; pub struct RelayChainAssetId; impl Get for RelayChainAssetId { @@ -166,12 +167,11 @@ impl hydradx_traits::registry::BoundErc20 for NoEvmSupport { } } // impl orml_traits::MultiCurrency { -// -// +// +// // } -impl MultiCurrency for NoEvmSupport -{ +impl MultiCurrency for NoEvmSupport { type CurrencyId = EvmAddress; type Balance = Balance; @@ -212,11 +212,7 @@ impl MultiCurrency for NoEvmSupport Err(DispatchError::Other("EVM not supported")) } - fn withdraw( - _contract: Self::CurrencyId, - _who: &AccountId, - _amount: Self::Balance, - ) -> sp_runtime::DispatchResult { + fn withdraw(_contract: Self::CurrencyId, _who: &AccountId, _amount: Self::Balance) -> sp_runtime::DispatchResult { Err(DispatchError::Other("EVM not supported")) } @@ -908,4 +904,4 @@ impl SwappablePaymentAssetTrader for XykPaymentAsse dest, ) } -} \ No newline at end of file +}