use crate::{Hash as HashPrimitive, *};
use frame_support::{pallet_prelude::ConstU32, parameter_types, weights::IdentityFee};
use polkadot_runtime_common::SlowAdjustingFeeUpdate;
use sp_runtime::traits::BlakeTwo256;
use t3rn_primitives::monetary::EXISTENTIAL_DEPOSIT;
parameter_types! {
pub const Version: RuntimeVersion = VERSION;
}
impl frame_system::Config for Runtime {
type AccountData = pallet_balances::AccountData<Balance>;
type AccountId = AccountId;
type BaseCallFilter = frame_support::traits::Everything;
type Block = Block;
type BlockHashCount = BlockHashCount;
type BlockLength = circuit_runtime_types::RuntimeBlockLength;
type BlockWeights = circuit_runtime_types::RuntimeBlockWeights;
type DbWeight = RocksDbWeight;
type Hash = HashPrimitive;
type Hashing = BlakeTwo256;
type Lookup = AccountIdLookup<AccountId, ()>;
type MaxConsumers = frame_support::traits::ConstU32<16>;
type Nonce = u32;
type OnKilledAccount = ();
type OnNewAccount = ();
type OnSetCode = cumulus_pallet_parachain_system::ParachainSetCode<Self>;
type PalletInfo = PalletInfo;
type RuntimeCall = RuntimeCall;
type RuntimeEvent = RuntimeEvent;
type RuntimeOrigin = RuntimeOrigin;
type SS58Prefix = circuit_runtime_types::SS58PrefixT1rn;
type SystemWeightInfo = ();
type Version = Version;
}
impl pallet_randomness_collective_flip::Config for Runtime {}
parameter_types! {
pub const MinimumPeriod: u64 = SLOT_DURATION / 2;
}
impl pallet_timestamp::Config for Runtime {
type MinimumPeriod = MinimumPeriod;
type Moment = u64;
type OnTimestampSet = Aura;
type WeightInfo = ();
}
parameter_types! {
pub const ExistentialDeposit: Balance = EXISTENTIAL_DEPOSIT; pub const MaxLocks: u32 = 50;
pub const MaxReserves: u32 = 50;
}
impl pallet_balances::Config for Runtime {
type AccountStore = System;
type Balance = Balance;
type DustRemoval = ();
type ExistentialDeposit = ExistentialDeposit;
type FreezeIdentifier = ();
type MaxFreezes = ConstU32<0>;
type MaxHolds = ConstU32<0>;
type MaxLocks = MaxLocks;
type MaxReserves = MaxReserves;
type ReserveIdentifier = [u8; 8];
type RuntimeEvent = RuntimeEvent;
type RuntimeHoldReason = RuntimeHoldReason;
type WeightInfo = pallet_balances::weights::SubstrateWeight<Runtime>;
}
parameter_types! {
pub const TransactionByteFee: Balance = 1;
pub const OperationalFeeMultiplier: u8 = 5;
}
impl pallet_transaction_payment::Config for Runtime {
type FeeMultiplierUpdate = SlowAdjustingFeeUpdate<Self>;
type LengthToFee = ConstantMultiplier<Balance, TransactionByteFee>;
type OnChargeTransaction = pallet_transaction_payment::CurrencyAdapter<Balances, ()>;
type OperationalFeeMultiplier = OperationalFeeMultiplier;
type RuntimeEvent = RuntimeEvent;
type WeightToFee = IdentityFee<Balance>;
}
impl pallet_sudo::Config for Runtime {
type RuntimeCall = RuntimeCall;
type RuntimeEvent = RuntimeEvent;
type WeightInfo = ();
}
impl pallet_utility::Config for Runtime {
type PalletsOrigin = OriginCaller;
type RuntimeCall = RuntimeCall;
type RuntimeEvent = RuntimeEvent;
type WeightInfo = pallet_utility::weights::SubstrateWeight<Runtime>;
}