timechain_runtime/configs/
utilities.rsuse scale_codec::{Decode, DecodeWithMemTracking, Encode, MaxEncodedLen};
use polkadot_sdk::*;
use frame_support::{
parameter_types,
traits::{ConstU32, InstanceFilter},
};
use sp_runtime::{traits::BlakeTwo256, RuntimeDebug};
use crate::{
deposit, weights, Balance, Balances, OriginCaller, Runtime, RuntimeCall, RuntimeEvent, System,
};
impl pallet_utility::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type RuntimeCall = RuntimeCall;
type PalletsOrigin = OriginCaller;
type WeightInfo = weights::pallet_utility::WeightInfo<Runtime>;
}
parameter_types! {
pub const DepositBase: Balance = deposit(1, 88);
pub const DepositFactor: Balance = deposit(0, 32);
}
impl pallet_multisig::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type RuntimeCall = RuntimeCall;
type Currency = Balances;
type DepositBase = DepositBase;
type DepositFactor = DepositFactor;
type MaxSignatories = ConstU32<100>;
type WeightInfo = weights::pallet_multisig::WeightInfo<Runtime>;
type BlockNumberProvider = System;
}
parameter_types! {
pub const ProxyDepositBase: Balance = deposit(1, 8);
pub const ProxyDepositFactor: Balance = deposit(0, 33);
pub const AnnouncementDepositBase: Balance = deposit(1, 16);
pub const AnnouncementDepositFactor: Balance = deposit(0, 68);
}
#[derive(
Copy,
Clone,
Eq,
PartialEq,
Ord,
PartialOrd,
Encode,
Decode,
DecodeWithMemTracking,
RuntimeDebug,
MaxEncodedLen,
scale_info::TypeInfo,
)]
pub enum ProxyType {
Any,
NonTransfer,
Governance,
Staking,
}
impl Default for ProxyType {
fn default() -> Self {
Self::Any
}
}
impl InstanceFilter<RuntimeCall> for ProxyType {
fn filter(&self, c: &RuntimeCall) -> bool {
match self {
ProxyType::Any => true,
ProxyType::NonTransfer => !matches!(
c,
RuntimeCall::Balances(..)
| RuntimeCall::Vesting(pallet_vesting::Call::vested_transfer { .. })
),
ProxyType::Governance => {
matches!(c, RuntimeCall::TechnicalCommittee(..)) },
#[cfg(feature = "testnet")]
ProxyType::Staking => {
matches!(c, RuntimeCall::Staking(..))
},
#[allow(unreachable_patterns)]
_ => false,
}
}
fn is_superset(&self, o: &Self) -> bool {
match (self, o) {
(x, y) if x == y => true,
(ProxyType::Any, _) => true,
(_, ProxyType::Any) => false,
(ProxyType::NonTransfer, _) => true,
_ => false,
}
}
}
impl pallet_proxy::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type RuntimeCall = RuntimeCall;
type Currency = Balances;
type ProxyType = ProxyType;
type ProxyDepositBase = ProxyDepositBase;
type ProxyDepositFactor = ProxyDepositFactor;
type MaxProxies = ConstU32<32>;
type WeightInfo = weights::pallet_proxy::WeightInfo<Runtime>;
type MaxPending = ConstU32<32>;
type CallHasher = BlakeTwo256;
type AnnouncementDepositBase = AnnouncementDepositBase;
type AnnouncementDepositFactor = AnnouncementDepositFactor;
type BlockNumberProvider = System;
}