Skip to content

Commit

Permalink
cargo fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
lemunozm committed May 28, 2024
1 parent b886c46 commit 9c27823
Show file tree
Hide file tree
Showing 17 changed files with 149 additions and 143 deletions.
5 changes: 3 additions & 2 deletions libs/types/src/locations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,9 @@ impl From<VersionedLocation> for RestrictedTransferLocation {
// type here -- 592 bytes, vs 40 bytes for domain address (next largest)
Self::XCM(BlakeTwo256::hash(&vml.encode()))

// TODO-1.7: I'm afraid of locations translated from v3 to v4 will generate a different hash here.
// How this affect our current chain state?
// TODO-1.7: I'm afraid of locations translated from v3 to v4 will
// generate a different hash here. How this affect our current chain
// state?
}
}

Expand Down
2 changes: 1 addition & 1 deletion pallets/ethereum-transaction/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -143,11 +143,11 @@ impl pallet_evm::Config for Runtime {
type PrecompilesValue = MockPrecompiles;
type Runner = Runner<Self>;
type RuntimeEvent = RuntimeEvent;
type SuicideQuickClearLimit = ConstU32<0>;
type Timestamp = Timestamp;
type WeightInfo = ();
type WeightPerGas = WeightPerGas;
type WithdrawOrigin = EnsureAddressNever<Self::AccountId>;
type SuicideQuickClearLimit = ConstU32<0>;
}

parameter_types! {
Expand Down
16 changes: 8 additions & 8 deletions pallets/fees/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,20 @@ parameter_types! {

impl pallet_treasury::Config for Runtime {
type ApproveOrigin = EnsureSignedBy<Admin, u64>;
type AssetKind = ();
type BalanceConverter = UnityAssetBalanceConversion;
#[cfg(feature = "runtime-benchmarks")]
type BenchmarkHelper = ();
type Beneficiary = Self::AccountId;
type BeneficiaryLookup = IdentityLookup<Self::Beneficiary>;
type Burn = ();
type BurnDestination = ();
type Currency = Balances;
type MaxApprovals = ();
type OnSlash = Treasury;
type PalletId = TreasuryPalletId;
type Paymaster = PayFromAccount<Balances, TreasuryAccount>;
type PayoutPeriod = ConstU64<10>;
type ProposalBond = ();
type ProposalBondMaximum = ();
type ProposalBondMinimum = ();
Expand All @@ -76,14 +84,6 @@ impl pallet_treasury::Config for Runtime {
type SpendOrigin = EnsureSignedBy<Admin, u64>;
type SpendPeriod = ();
type WeightInfo = ();
type AssetKind = ();
type Beneficiary = Self::AccountId;
type BeneficiaryLookup = IdentityLookup<Self::Beneficiary>;
type Paymaster = PayFromAccount<Balances, TreasuryAccount>;
type BalanceConverter = UnityAssetBalanceConversion;
type PayoutPeriod = ConstU64<10>;
#[cfg(feature = "runtime-benchmarks")]
type BenchmarkHelper = ();
}

parameter_types! {
Expand Down
4 changes: 2 additions & 2 deletions pallets/liquidity-pools-gateway/routers/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -218,11 +218,11 @@ impl pallet_evm::Config for Runtime {
type PrecompilesValue = MockPrecompiles;
type Runner = Runner<Self>;
type RuntimeEvent = RuntimeEvent;
type SuicideQuickClearLimit = ConstU32<0>;
type Timestamp = Timestamp;
type WeightInfo = ();
type WeightPerGas = WeightPerGas;
type WithdrawOrigin = EnsureAddressNever<Self::AccountId>;
type SuicideQuickClearLimit = ConstU32<0>;
}

parameter_types! {
Expand Down Expand Up @@ -454,6 +454,7 @@ impl pallet_xcm_transactor::Config for Runtime {
type CurrencyIdToLocation = CurrencyIdToLocation;
type DerivativeAddressRegistrationOrigin = EnsureRoot<AccountId32>;
type HrmpManipulatorOrigin = EnsureRoot<AccountId32>;
type HrmpOpenOrigin = EnsureRoot<AccountId32>;
type MaxHrmpFee = MaxHrmpRelayFee;
type ReserveProvider = orml_traits::location::RelativeReserveProvider;
type RuntimeEvent = RuntimeEvent;
Expand All @@ -462,7 +463,6 @@ impl pallet_xcm_transactor::Config for Runtime {
type Transactor = Transactors;
type UniversalLocation = UniversalLocation;
type Weigher = DummyWeigher<RuntimeCall>;
type HrmpOpenOrigin = EnsureRoot<AccountId32>;
type WeightInfo = ();
type XcmSender = TestSendXcm;
}
Expand Down
8 changes: 4 additions & 4 deletions pallets/restricted-xtokens/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@
//! - `transfer_multiasset`: Transfer `Asset` assets.
//! - `transfer_with_fee`: Transfer native currencies specifying the fee and
//! amount as separate.
//! - `transfer_multiasset_with_fee`: Transfer `Asset` specifying the fee
//! and amount as separate.
//! - `transfer_multiasset_with_fee`: Transfer `Asset` specifying the fee and
//! amount as separate.
//! - `transfer_multicurrencies`: Transfer several currencies specifying the
//! item to be used as fee.
//! - `transfer_multiassets`: Transfer several `Asset` specifying the item
//! to be used as fee.
//! - `transfer_multiassets`: Transfer several `Asset` specifying the item to be
//! used as fee.
#![cfg_attr(not(feature = "std"), no_std)]
#![allow(clippy::from_over_into)]
Expand Down
3 changes: 1 addition & 2 deletions pallets/rewards/src/issuance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ use cfg_traits::rewards::RewardIssuance;
use frame_support::traits::{fungibles::Mutate, tokens::Preservation};
use parity_scale_codec::{Decode, Encode};
use sp_runtime::{traits::Get, DispatchResult};
use sp_std::cmp::Eq;
use sp_std::marker::PhantomData;
use sp_std::{cmp::Eq, marker::PhantomData};

/// Enables rewarding out of thin air, e.g. via minting.
pub struct MintReward<AccountId, Balance, CurrencyId, Currency>(
Expand Down
2 changes: 1 addition & 1 deletion pallets/transfer-allowlist/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,10 @@ impl pallet_balances::Config for Runtime {
impl transfer_allowlist::Config for Runtime {
type CurrencyId = FilterCurrency;
type Deposit = ConstU64<10>;
type RuntimeHoldReason = RuntimeHoldReason;
type Location = Location;
type ReserveCurrency = Balances;
type RuntimeEvent = RuntimeEvent;
type RuntimeHoldReason = RuntimeHoldReason;
type WeightInfo = ();
}

Expand Down
66 changes: 33 additions & 33 deletions runtime/altair/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,7 @@ use cfg_types::{
},
};
use constants::currency::*;
use cumulus_primitives_core::AggregateMessageOrigin;
use cumulus_primitives_core::ParaId;
use cumulus_primitives_core::{AggregateMessageOrigin, ParaId};
use fp_rpc::TransactionStatus;
use frame_support::{
construct_runtime,
Expand Down Expand Up @@ -98,7 +97,6 @@ use parity_scale_codec::{Decode, Encode, MaxEncodedLen};
use polkadot_runtime_common::{
prod_or_fast, xcm_sender::NoPriceForMessageDelivery, BlockHashCount, SlowAdjustingFeeUpdate,
};
use runtime_common::transfer_filter::PreNativeTransfer;
use runtime_common::{
account_conversion::{AccountConverter, RuntimeAccountConverter},
asset_registry,
Expand All @@ -116,7 +114,7 @@ use runtime_common::{
permissions::PoolAdminCheck,
remarks::Remark,
rewards::SingleCurrencyMovement,
transfer_filter::PreLpTransfer,
transfer_filter::{PreLpTransfer, PreNativeTransfer},
xcm::AccountIdToLocation,
xcm_transactor, AllowanceDeposit, CurrencyED,
};
Expand Down Expand Up @@ -246,11 +244,11 @@ impl frame_system::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
/// The ubiquitous origin type.
type RuntimeOrigin = RuntimeOrigin;
type RuntimeTask = RuntimeTask;
type SS58Prefix = SS58Prefix;
type SystemWeightInfo = weights::frame_system::WeightInfo<Runtime>;
/// Get the chain's current version.
type Version = Version;
type RuntimeTask = RuntimeTask;
}

/// Base Call Filter
Expand Down Expand Up @@ -299,15 +297,16 @@ parameter_types! {

impl cumulus_pallet_parachain_system::Config for Runtime {
type CheckAssociatedRelayNumber = cumulus_pallet_parachain_system::RelayNumberStrictlyIncreases;
// Using weights for recomended hardware
type DmpQueue = frame_support::traits::EnqueueWithOrigin<MessageQueue, RelayOrigin>;
type OnSystemEvent = ();
type OutboundXcmpMessageSource = XcmpQueue;
type ReservedDmpWeight = ReservedDmpWeight;
type ReservedXcmpWeight = ReservedXcmpWeight;
type RuntimeEvent = RuntimeEvent;
type XcmpMessageHandler = XcmpQueue;
type WeightInfo = (); // Using weights for recomended hardware
type DmpQueue = frame_support::traits::EnqueueWithOrigin<MessageQueue, RelayOrigin>;
type SelfParaId = staging_parachain_info::Pallet<Runtime>;
type WeightInfo = ();
type XcmpMessageHandler = XcmpQueue;
}

impl staging_parachain_info::Config for Runtime {}
Expand All @@ -317,8 +316,9 @@ parameter_types! {
}

impl pallet_message_queue::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type WeightInfo = (); // Using weights for recomended hardware
type HeapSize = sp_core::ConstU32<{ 64 * 1024 }>;
type MaxStale = sp_core::ConstU32<8>;
// Using weights for recomended hardware
#[cfg(feature = "runtime-benchmarks")]
type MessageProcessor =
pallet_message_queue::mock_helpers::NoopMessageProcessor<AggregateMessageOrigin>;
Expand All @@ -328,26 +328,26 @@ impl pallet_message_queue::Config for Runtime {
staging_xcm_executor::XcmExecutor<XcmConfig>,
RuntimeCall,
>;
type Size = u32;
type QueueChangeHandler = NarrowOriginToSibling<XcmpQueue>;
type QueuePausedQuery = NarrowOriginToSibling<XcmpQueue>;
type HeapSize = sp_core::ConstU32<{ 64 * 1024 }>;
type MaxStale = sp_core::ConstU32<8>;
type RuntimeEvent = RuntimeEvent;
type ServiceWeight = MessageQueueServiceWeight;
type Size = u32;
type WeightInfo = ();
}

/// XCMP Queue is responsible to handle XCM messages coming directly from
/// sibling parachains.
impl cumulus_pallet_xcmp_queue::Config for Runtime {
type ChannelInfo = ParachainSystem;
type ControllerOrigin = EnsureRoot<AccountId>;
type XcmpQueue = TransformOrigin<MessageQueue, AggregateMessageOrigin, ParaId, ParaIdToSibling>;
type MaxInboundSuspended = sp_core::ConstU32<1_000>;
type ControllerOriginConverter = XcmOriginToTransactDispatchOrigin;
type MaxInboundSuspended = sp_core::ConstU32<1_000>;
type PriceForSiblingDelivery = NoPriceForMessageDelivery<ParaId>;
type RuntimeEvent = RuntimeEvent;
type VersionWrapper = PolkadotXcm;
type WeightInfo = weights::cumulus_pallet_xcmp_queue::WeightInfo<Runtime>;
type XcmpQueue = TransformOrigin<MessageQueue, AggregateMessageOrigin, ParaId, ParaIdToSibling>;
}

parameter_types! {
Expand Down Expand Up @@ -404,8 +404,8 @@ impl pallet_balances::Config for Runtime {
type ReserveIdentifier = [u8; 8];
/// The overarching event type.
type RuntimeEvent = RuntimeEvent;
type RuntimeHoldReason = RuntimeHoldReason;
type RuntimeFreezeReason = RuntimeFreezeReason;
type RuntimeHoldReason = RuntimeHoldReason;
type WeightInfo = weights::pallet_balances::WeightInfo<Runtime>;
}

Expand Down Expand Up @@ -885,23 +885,23 @@ parameter_types! {

impl pallet_identity::Config for Runtime {
type BasicDeposit = BasicDeposit;
type Currency = Balances;
type ByteDeposit = ByteDeposit;
type Currency = Balances;
type ForceOrigin = EnsureRootOr<EnsureProportionMoreThan<AccountId, CouncilCollective, 1, 2>>;
type IdentityInformation = pallet_identity::legacy::IdentityInfo<MaxAdditionalFields>;
type MaxRegistrars = MaxRegistrars;
type MaxSubAccounts = MaxSubAccounts;
type MaxSuffixLength = ConstU32<7>;
type MaxUsernameLength = ConstU32<32>;
type OffchainSignature = Signature;
type PendingUsernameExpiration = ConstU32<{ 7 * DAYS }>;
type RegistrarOrigin =
EnsureRootOr<EnsureProportionMoreThan<AccountId, CouncilCollective, 1, 2>>;
type RuntimeEvent = RuntimeEvent;
type SigningPublicKey = <Signature as Verify>::Signer;
type Slashed = Treasury;
type SubAccountDeposit = SubAccountDeposit;
type OffchainSignature = Signature;
type SigningPublicKey = <Signature as Verify>::Signer;
type UsernameAuthorityOrigin = EnsureRoot<Self::AccountId>;
type PendingUsernameExpiration = ConstU32<{ 7 * DAYS }>;
type MaxSuffixLength = ConstU32<7>;
type MaxUsernameLength = ConstU32<32>;
type WeightInfo = weights::pallet_identity::WeightInfo<Runtime>;
}

Expand All @@ -912,12 +912,12 @@ parameter_types! {
}

impl pallet_vesting::Config for Runtime {
type BlockNumberProvider = System;
type BlockNumberToBalance = ConvertInto;
type Currency = Balances;
type MinVestedTransfer = MinVestedTransfer;
type RuntimeEvent = RuntimeEvent;
type UnvestedFundsAllowedWithdrawReasons = UnvestedFundsAllowedWithdrawReasons;
type BlockNumberProvider = System;
type WeightInfo = weights::pallet_vesting::WeightInfo<Runtime>;

const MAX_VESTING_SCHEDULES: u32 = 28;
Expand Down Expand Up @@ -952,12 +952,20 @@ parameter_types! {

impl pallet_treasury::Config for Runtime {
type ApproveOrigin = EnsureRootOr<TwoThirdOfCouncil>;
type AssetKind = ();
type BalanceConverter = UnityAssetBalanceConversion;
#[cfg(feature = "runtime-benchmarks")]
type BenchmarkHelper = ();
type Beneficiary = Self::AccountId;
type BeneficiaryLookup = IdentityLookup<Self::Beneficiary>;
type Burn = Burn;
type BurnDestination = ();
type Currency = Tokens;
type MaxApprovals = MaxApprovals;
type OnSlash = Treasury;
type PalletId = TreasuryPalletId;
type Paymaster = PayFromAccount<Balances, TreasuryAccount>;
type PayoutPeriod = ConstU32<10>;
type ProposalBond = ProposalBond;
type ProposalBondMaximum = ProposalBondMaximum;
type ProposalBondMinimum = ProposalBondMinimum;
Expand All @@ -967,14 +975,6 @@ impl pallet_treasury::Config for Runtime {
type SpendOrigin = frame_support::traits::NeverEnsureOrigin<Balance>;
type SpendPeriod = SpendPeriod;
type WeightInfo = weights::pallet_treasury::WeightInfo<Runtime>;
type AssetKind = ();
type Beneficiary = Self::AccountId;
type BeneficiaryLookup = IdentityLookup<Self::Beneficiary>;
type Paymaster = PayFromAccount<Balances, TreasuryAccount>;
type BalanceConverter = UnityAssetBalanceConversion;
type PayoutPeriod = ConstU32<10>;
#[cfg(feature = "runtime-benchmarks")]
type BenchmarkHelper = ();
}

parameter_types! {
Expand Down Expand Up @@ -1408,6 +1408,7 @@ impl pallet_xcm_transactor::Config for Runtime {
type CurrencyIdToLocation = CurrencyIdConvert;
type DerivativeAddressRegistrationOrigin = EnsureRoot<AccountId>;
type HrmpManipulatorOrigin = EnsureRootOr<HalfOfCouncil>;
type HrmpOpenOrigin = EnsureRoot<AccountId>;
type MaxHrmpFee = staging_xcm_builder::Case<MaxHrmpRelayFee>;
type ReserveProvider = xcm_primitives::AbsoluteAndRelativeReserve<SelfLocation>;
type RuntimeEvent = RuntimeEvent;
Expand All @@ -1417,7 +1418,6 @@ impl pallet_xcm_transactor::Config for Runtime {
type UniversalLocation = UniversalLocation;
type Weigher = XcmWeigher;
type WeightInfo = ();
type HrmpOpenOrigin = EnsureRoot<AccountId>;
type XcmSender = XcmRouter;
}

Expand Down Expand Up @@ -1880,11 +1880,11 @@ impl pallet_evm::Config for Runtime {
type PrecompilesValue = PrecompilesValue;
type Runner = pallet_evm::runner::stack::Runner<Self>;
type RuntimeEvent = RuntimeEvent;
type SuicideQuickClearLimit = ConstU32<0>;
type Timestamp = Timestamp;
type WeightInfo = ();
type WeightPerGas = WeightPerGas;
type WithdrawOrigin = EnsureAddressTruncated;
type SuicideQuickClearLimit = ConstU32<0>;
}

impl pallet_evm_chain_id::Config for Runtime {}
Expand Down
4 changes: 2 additions & 2 deletions runtime/altair/src/xcm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,11 @@ impl staging_xcm_executor::Config for XcmConfig {
type SafeCallFilter = SafeCallFilter;
type SubscriptionService = PolkadotXcm;
type Trader = Trader;
type TransactionalProcessor = FrameTransactionalProcessor;
type UniversalAliases = Nothing;
type UniversalLocation = UniversalLocation;
type Weigher = FixedWeightBounds<UnitWeightCost, RuntimeCall, MaxInstructions>;
type XcmSender = XcmRouter;
type TransactionalProcessor = FrameTransactionalProcessor;
}

/// Trader - The means of purchasing weight credit for XCM execution.
Expand Down Expand Up @@ -257,9 +257,9 @@ impl orml_xtokens::Config for Runtime {
type BaseXcmWeight = BaseXcmWeight;
type CurrencyId = CurrencyId;
type CurrencyIdConvert = CurrencyIdConvert;
type LocationsFilter = Everything;
type MaxAssetsForTransfer = MaxAssetsForTransfer;
type MinXcmFee = ParachainMinFee;
type LocationsFilter = Everything;
type ReserveProvider = AbsoluteReserveProvider;
type RuntimeEvent = RuntimeEvent;
type SelfLocation = SelfLocation;
Expand Down
Loading

0 comments on commit 9c27823

Please sign in to comment.