Skip to content

Commit

Permalink
style: cargo fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
TarekkMA committed Nov 6, 2024
1 parent 3d3a459 commit 5425f91
Show file tree
Hide file tree
Showing 17 changed files with 63 additions and 29 deletions.
12 changes: 5 additions & 7 deletions node/cli/src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@ use moonbeam_service::{
use parity_scale_codec::Encode;
#[cfg(feature = "westend-native")]
use polkadot_service::WestendChainSpec;
use sc_cli::{ChainSpec, CliConfiguration, DefaultConfigurationValues, ImportParams, KeystoreParams, NetworkParams, Result, RpcEndpoint, RuntimeVersion, SharedParams, SubstrateCli};
use sc_cli::{
ChainSpec, CliConfiguration, DefaultConfigurationValues, ImportParams, KeystoreParams,
NetworkParams, Result, RpcEndpoint, RuntimeVersion, SharedParams, SubstrateCli,
};
use sc_service::{
config::{BasePath, PrometheusConfig},
DatabaseSource, PartialComponents,
Expand Down Expand Up @@ -953,12 +956,7 @@ impl CliConfiguration<Self> for RelayChainCli {
.prometheus_config(default_listen_port, chain_spec)
}

fn init<F>(
&self,
_support_url: &String,
_impl_version: &String,
_logger_hook: F,
) -> Result<()>
fn init<F>(&self, _support_url: &String, _impl_version: &String, _logger_hook: F) -> Result<()>
where
F: FnOnce(&mut sc_cli::LoggerBuilder),
{
Expand Down
3 changes: 2 additions & 1 deletion node/service/src/lazy_loading/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,8 @@ where
};

let prometheus_registry = config.prometheus_registry().cloned();
let net_config = FullNetworkConfiguration::<_, _, Net>::new(&config.network, prometheus_registry.clone());
let net_config =
FullNetworkConfiguration::<_, _, Net>::new(&config.network, prometheus_registry.clone());

let metrics = Net::register_notification_metrics(
config.prometheus_config.as_ref().map(|cfg| &cfg.registry),
Expand Down
8 changes: 6 additions & 2 deletions node/service/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -679,7 +679,10 @@ where
let prometheus_registry = parachain_config.prometheus_registry().cloned();
let transaction_pool = params.transaction_pool.clone();
let import_queue_service = params.import_queue.service();
let net_config = FullNetworkConfiguration::<_, _, Net>::new(&parachain_config.network, prometheus_registry.clone());
let net_config = FullNetworkConfiguration::<_, _, Net>::new(
&parachain_config.network,
prometheus_registry.clone(),
);

let (network, system_rpc_tx, tx_handler_controller, start_network, sync_service) =
cumulus_client_service::build_network(cumulus_client_service::BuildNetworkParams {
Expand Down Expand Up @@ -1197,7 +1200,8 @@ where
};

let prometheus_registry = config.prometheus_registry().cloned();
let net_config = FullNetworkConfiguration::<_, _, Net>::new(&config.network, prometheus_registry.clone());
let net_config =
FullNetworkConfiguration::<_, _, Net>::new(&config.network, prometheus_registry.clone());

let metrics = Net::register_notification_metrics(
config.prometheus_config.as_ref().map(|cfg| &cfg.registry),
Expand Down
6 changes: 4 additions & 2 deletions pallets/ethereum-xcm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,8 @@ pub use self::pallet::*;

#[frame_support::pallet(dev_mode)]
pub mod pallet {
use fp_evm::AccountProvider;
use super::*;
use fp_evm::AccountProvider;
use frame_support::pallet_prelude::*;

#[pallet::config]
Expand All @@ -123,7 +123,9 @@ pub mod pallet {
/// Maximum Weight reserved for xcm in a block
type ReservedXcmpWeight: Get<Weight>;
/// Ensure proxy
type EnsureProxy: EnsureProxy<<<Self as pallet_evm::Config>::AccountProvider as AccountProvider>::AccountId>;
type EnsureProxy: EnsureProxy<
<<Self as pallet_evm::Config>::AccountProvider as AccountProvider>::AccountId,
>;
/// The origin that is allowed to resume or suspend the XCM to Ethereum executions.
type ControllerOrigin: EnsureOrigin<Self::RuntimeOrigin>;
/// An origin that can submit a create tx type
Expand Down
4 changes: 3 additions & 1 deletion pallets/ethereum-xcm/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ use frame_support::{
ConsensusEngineId, PalletId,
};
use frame_system::{pallet_prelude::BlockNumberFor, EnsureRoot};
use pallet_evm::{AddressMapping, EnsureAddressTruncated, FeeCalculator, FrameSystemAccountProvider};
use pallet_evm::{
AddressMapping, EnsureAddressTruncated, FeeCalculator, FrameSystemAccountProvider,
};
use rlp::RlpStream;
use sp_core::{hashing::keccak_256, H160, H256, U256};
use sp_runtime::{
Expand Down
4 changes: 3 additions & 1 deletion precompiles/author-mapping/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ use frame_support::{
weights::Weight,
};
use frame_system::EnsureRoot;
use pallet_evm::{EnsureAddressNever, EnsureAddressRoot, FrameSystemAccountProvider, SubstrateBlockHashMapping};
use pallet_evm::{
EnsureAddressNever, EnsureAddressRoot, FrameSystemAccountProvider, SubstrateBlockHashMapping,
};
use precompile_utils::{mock_account, precompile_set::*, testing::MockAccount};
use sp_core::{H256, U256};
use sp_io;
Expand Down
4 changes: 3 additions & 1 deletion precompiles/collective/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ use frame_support::{
PalletId,
};
use frame_system::pallet_prelude::BlockNumberFor;
use pallet_evm::{EnsureAddressNever, EnsureAddressRoot, FrameSystemAccountProvider, SubstrateBlockHashMapping};
use pallet_evm::{
EnsureAddressNever, EnsureAddressRoot, FrameSystemAccountProvider, SubstrateBlockHashMapping,
};
use precompile_utils::{
precompile_set::*,
testing::{Bob, Charlie, MockAccount},
Expand Down
4 changes: 3 additions & 1 deletion precompiles/proxy/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ use frame_support::{
traits::{Everything, InstanceFilter},
weights::Weight,
};
use pallet_evm::{EnsureAddressNever, EnsureAddressOrigin, FrameSystemAccountProvider, SubstrateBlockHashMapping};
use pallet_evm::{
EnsureAddressNever, EnsureAddressOrigin, FrameSystemAccountProvider, SubstrateBlockHashMapping,
};
use precompile_utils::{
precompile_set::{
AddressU64, CallableByContract, CallableByPrecompile, OnlyFrom, PrecompileAt,
Expand Down
4 changes: 3 additions & 1 deletion precompiles/xcm-transactor/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ use frame_support::{
traits::{EnsureOrigin, Everything, OriginTrait, PalletInfo as PalletInfoTrait},
weights::{RuntimeDbWeight, Weight},
};
use pallet_evm::{EnsureAddressNever, EnsureAddressRoot, FrameSystemAccountProvider, GasWeightMapping};
use pallet_evm::{
EnsureAddressNever, EnsureAddressRoot, FrameSystemAccountProvider, GasWeightMapping,
};
use parity_scale_codec::{Decode, Encode};
use precompile_utils::{
mock_account,
Expand Down
2 changes: 1 addition & 1 deletion precompiles/xcm-transactor/src/v1/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@

//! Precompile to xcm transactor runtime methods via the EVM

use crate::functions::{CurrencyIdOf, GetDataLimit, TransactorOf, XcmTransactorWrapper};
use fp_evm::PrecompileHandle;
use frame_support::dispatch::{GetDispatchInfo, PostDispatchInfo};
use pallet_evm::AddressMapping;
use crate::functions::{CurrencyIdOf, GetDataLimit, TransactorOf, XcmTransactorWrapper};
use precompile_utils::prelude::*;
use sp_core::{H160, U256};
use sp_runtime::traits::Dispatchable;
Expand Down
4 changes: 3 additions & 1 deletion precompiles/xcm-utils/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ use frame_support::{
traits::{ConstU32, EnsureOrigin, Everything, Nothing, OriginTrait, PalletInfo as _},
weights::{RuntimeDbWeight, Weight},
};
use pallet_evm::{EnsureAddressNever, EnsureAddressRoot, FrameSystemAccountProvider, GasWeightMapping};
use pallet_evm::{
EnsureAddressNever, EnsureAddressRoot, FrameSystemAccountProvider, GasWeightMapping,
};
use precompile_utils::{
mock_account,
precompile_set::*,
Expand Down
9 changes: 7 additions & 2 deletions runtime/moonbase/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,11 @@ use moonbeam_runtime_common::{
use nimbus_primitives::CanAuthor;
use pallet_ethereum::Call::transact;
use pallet_ethereum::{PostLogContent, Transaction as EthereumTransaction};
use pallet_evm::{Account as EVMAccount, EVMFungibleAdapter, EnsureAddressNever, EnsureAddressRoot, FeeCalculator, FrameSystemAccountProvider, GasWeightMapping, IdentityAddressMapping, OnChargeEVMTransaction as OnChargeEVMTransactionT, Runner};
use pallet_evm::{
Account as EVMAccount, EVMFungibleAdapter, EnsureAddressNever, EnsureAddressRoot,
FeeCalculator, FrameSystemAccountProvider, GasWeightMapping, IdentityAddressMapping,
OnChargeEVMTransaction as OnChargeEVMTransactionT, Runner,
};
use pallet_transaction_payment::{FungibleAdapter, Multiplier, TargetedFeeAdjustment};
use pallet_treasury::TreasuryAccountId;
use parity_scale_codec::{Decode, Encode, MaxEncodedLen};
Expand Down Expand Up @@ -707,7 +711,8 @@ parameter_types! {

impl pallet_ethereum::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type StateRoot = pallet_ethereum::IntermediateStateRoot<<Runtime as frame_system::Config>::Version>;
type StateRoot =
pallet_ethereum::IntermediateStateRoot<<Runtime as frame_system::Config>::Version>;
type PostLogContent = PostBlockAndTxnHashes;
type ExtraDataLength = ConstU32<30>;
}
Expand Down
5 changes: 3 additions & 2 deletions runtime/moonbase/tests/xcm_mock/parachain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -967,7 +967,8 @@ parameter_types! {

impl pallet_ethereum::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type StateRoot = pallet_ethereum::IntermediateStateRoot<<Runtime as frame_system::Config>::Version>;
type StateRoot =
pallet_ethereum::IntermediateStateRoot<<Runtime as frame_system::Config>::Version>;
type PostLogContent = PostBlockAndTxnHashes;
type ExtraDataLength = ConstU32<30>;
}
Expand Down Expand Up @@ -1085,8 +1086,8 @@ pub(crate) fn para_events() -> Vec<RuntimeEvent> {

use frame_support::traits::tokens::{PayFromAccount, UnityAssetBalanceConversion};
use frame_support::traits::{OnFinalize, OnInitialize, UncheckedOnRuntimeUpgrade};
use pallet_evm::FrameSystemAccountProvider;
use moonbase_runtime::Version;
use pallet_evm::FrameSystemAccountProvider;

pub(crate) fn on_runtime_upgrade() {
VersionUncheckedMigrateToV1::<Runtime>::on_runtime_upgrade();
Expand Down
6 changes: 5 additions & 1 deletion runtime/moonbeam/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,11 @@ use moonbeam_runtime_common::{
};
use pallet_ethereum::Call::transact;
use pallet_ethereum::{PostLogContent, Transaction as EthereumTransaction};
use pallet_evm::{Account as EVMAccount, EVMFungibleAdapter, EnsureAddressNever, EnsureAddressRoot, FeeCalculator, FrameSystemAccountProvider, GasWeightMapping, IdentityAddressMapping, OnChargeEVMTransaction as OnChargeEVMTransactionT, Runner};
use pallet_evm::{
Account as EVMAccount, EVMFungibleAdapter, EnsureAddressNever, EnsureAddressRoot,
FeeCalculator, FrameSystemAccountProvider, GasWeightMapping, IdentityAddressMapping,
OnChargeEVMTransaction as OnChargeEVMTransactionT, Runner,
};
pub use pallet_parachain_staking::{weights::WeightInfo, InflationInfo, Range};
use pallet_transaction_payment::{FungibleAdapter, Multiplier, TargetedFeeAdjustment};
use pallet_treasury::TreasuryAccountId;
Expand Down
3 changes: 2 additions & 1 deletion runtime/moonbeam/tests/xcm_mock/parachain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -953,7 +953,8 @@ parameter_types! {

impl pallet_ethereum::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type StateRoot = pallet_ethereum::IntermediateStateRoot<<Runtime as frame_system::Config>::Version>;
type StateRoot =
pallet_ethereum::IntermediateStateRoot<<Runtime as frame_system::Config>::Version>;
type PostLogContent = PostBlockAndTxnHashes;
type ExtraDataLength = ConstU32<30>;
}
Expand Down
9 changes: 7 additions & 2 deletions runtime/moonriver/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,11 @@ use moonbeam_runtime_common::{
};
use pallet_ethereum::Call::transact;
use pallet_ethereum::{PostLogContent, Transaction as EthereumTransaction};
use pallet_evm::{Account as EVMAccount, EVMFungibleAdapter, EnsureAddressNever, EnsureAddressRoot, FeeCalculator, FrameSystemAccountProvider, GasWeightMapping, IdentityAddressMapping, OnChargeEVMTransaction as OnChargeEVMTransactionT, Runner};
use pallet_evm::{
Account as EVMAccount, EVMFungibleAdapter, EnsureAddressNever, EnsureAddressRoot,
FeeCalculator, FrameSystemAccountProvider, GasWeightMapping, IdentityAddressMapping,
OnChargeEVMTransaction as OnChargeEVMTransactionT, Runner,
};
pub use pallet_parachain_staking::{weights::WeightInfo, InflationInfo, Range};
use pallet_transaction_payment::{FungibleAdapter, Multiplier, TargetedFeeAdjustment};
use pallet_treasury::TreasuryAccountId;
Expand Down Expand Up @@ -691,7 +695,8 @@ parameter_types! {

impl pallet_ethereum::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type StateRoot = pallet_ethereum::IntermediateStateRoot<<Runtime as frame_system::Config>::Version>;
type StateRoot =
pallet_ethereum::IntermediateStateRoot<<Runtime as frame_system::Config>::Version>;
type PostLogContent = PostBlockAndTxnHashes;
type ExtraDataLength = ConstU32<30>;
}
Expand Down
5 changes: 3 additions & 2 deletions runtime/moonriver/tests/xcm_mock/parachain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -958,7 +958,8 @@ parameter_types! {

impl pallet_ethereum::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type StateRoot = pallet_ethereum::IntermediateStateRoot<<Runtime as frame_system::Config>::Version>;
type StateRoot =
pallet_ethereum::IntermediateStateRoot<<Runtime as frame_system::Config>::Version>;
type PostLogContent = PostBlockAndTxnHashes;
type ExtraDataLength = ConstU32<30>;
}
Expand Down Expand Up @@ -1077,8 +1078,8 @@ pub(crate) fn para_events() -> Vec<RuntimeEvent> {

use frame_support::traits::tokens::{PayFromAccount, UnityAssetBalanceConversion};
use frame_support::traits::{OnFinalize, OnInitialize, UncheckedOnRuntimeUpgrade};
use pallet_evm::FrameSystemAccountProvider;
use moonriver_runtime::Version;
use pallet_evm::FrameSystemAccountProvider;

pub(crate) fn on_runtime_upgrade() {
VersionUncheckedMigrateToV1::<Runtime>::on_runtime_upgrade();
Expand Down

0 comments on commit 5425f91

Please sign in to comment.