testnet_parachains_constants/
westend.rs1pub mod account {
18 use frame_support::PalletId;
19
20 pub const WESTEND_TREASURY_PALLET_ID: PalletId = PalletId(*b"py/trsry");
23 pub const ALLIANCE_PALLET_ID: PalletId = PalletId(*b"py/allia");
26 pub const REFERENDA_PALLET_ID: PalletId = PalletId(*b"py/refer");
29 pub const AMBASSADOR_REFERENDA_PALLET_ID: PalletId = PalletId(*b"py/amref");
32 pub const FELLOWSHIP_TREASURY_PALLET_ID: PalletId = PalletId(*b"py/feltr");
34}
35
36pub mod currency {
37 use polkadot_core_primitives::Balance;
38 use westend_runtime_constants as constants;
39
40 pub const EXISTENTIAL_DEPOSIT: Balance = constants::currency::EXISTENTIAL_DEPOSIT / 10;
42
43 pub const UNITS: Balance = constants::currency::UNITS;
44 pub const DOLLARS: Balance = UNITS; pub const CENTS: Balance = constants::currency::CENTS;
46 pub const MILLICENTS: Balance = constants::currency::MILLICENTS;
47 pub const GRAND: Balance = constants::currency::GRAND;
48
49 pub const fn deposit(items: u32, bytes: u32) -> Balance {
50 constants::currency::deposit(items, bytes) / 100
52 }
53}
54
55pub mod fee {
57 use frame_support::{
58 pallet_prelude::Weight,
59 weights::{
60 constants::ExtrinsicBaseWeight, FeePolynomial, WeightToFeeCoefficient,
61 WeightToFeeCoefficients, WeightToFeePolynomial,
62 },
63 };
64 use polkadot_core_primitives::Balance;
65 use smallvec::smallvec;
66 pub use sp_runtime::Perbill;
67
68 pub const TARGET_BLOCK_FULLNESS: Perbill = Perbill::from_percent(25);
70
71 pub struct WeightToFee;
82 impl frame_support::weights::WeightToFee for WeightToFee {
83 type Balance = Balance;
84
85 fn weight_to_fee(weight: &Weight) -> Self::Balance {
86 let time_poly: FeePolynomial<Balance> = RefTimeToFee::polynomial().into();
87 let proof_poly: FeePolynomial<Balance> = ProofSizeToFee::polynomial().into();
88
89 time_poly.eval(weight.ref_time()).max(proof_poly.eval(weight.proof_size()))
91 }
92 }
93
94 pub struct RefTimeToFee;
96 impl WeightToFeePolynomial for RefTimeToFee {
97 type Balance = Balance;
98 fn polynomial() -> WeightToFeeCoefficients<Self::Balance> {
99 let p = super::currency::CENTS;
102 let q = 100 * Balance::from(ExtrinsicBaseWeight::get().ref_time());
103
104 smallvec![WeightToFeeCoefficient {
105 degree: 1,
106 negative: false,
107 coeff_frac: Perbill::from_rational(p % q, q),
108 coeff_integer: p / q,
109 }]
110 }
111 }
112
113 pub struct ProofSizeToFee;
115 impl WeightToFeePolynomial for ProofSizeToFee {
116 type Balance = Balance;
117 fn polynomial() -> WeightToFeeCoefficients<Self::Balance> {
118 let p = super::currency::CENTS;
120 let q = 10_000;
121
122 smallvec![WeightToFeeCoefficient {
123 degree: 1,
124 negative: false,
125 coeff_frac: Perbill::from_rational(p % q, q),
126 coeff_integer: p / q,
127 }]
128 }
129 }
130}
131
132pub mod consensus {
134 use frame_support::weights::{constants::WEIGHT_REF_TIME_PER_SECOND, Weight};
135
136 pub const UNINCLUDED_SEGMENT_CAPACITY: u32 = 3;
139 pub const BLOCK_PROCESSING_VELOCITY: u32 = 1;
142 pub const RELAY_CHAIN_SLOT_DURATION_MILLIS: u32 = 6000;
144
145 pub const MAXIMUM_BLOCK_WEIGHT: Weight = Weight::from_parts(
147 WEIGHT_REF_TIME_PER_SECOND.saturating_mul(2),
148 cumulus_primitives_core::relay_chain::MAX_POV_SIZE as u64,
149 );
150
151 pub const MILLISECS_PER_BLOCK: u64 = 6000;
158 pub const SLOT_DURATION: u64 = MILLISECS_PER_BLOCK;
159}
160
161pub mod time {
163 use polkadot_core_primitives::BlockNumber;
164
165 pub const MINUTES: BlockNumber =
167 60_000 / (super::consensus::MILLISECS_PER_BLOCK as BlockNumber);
168 pub const HOURS: BlockNumber = MINUTES * 60;
169 pub const DAYS: BlockNumber = HOURS * 24;
170}
171
172pub mod snowbridge {
173 use cumulus_primitives_core::ParaId;
174 use frame_support::parameter_types;
175 use xcm::prelude::{Location, NetworkId};
176
177 pub const INBOUND_QUEUE_PALLET_INDEX_V1: u8 = 80;
179 pub const INBOUND_QUEUE_PALLET_INDEX_V2: u8 = 91;
180
181 pub const FRONTEND_PALLET_INDEX: u8 = 36;
182
183 parameter_types! {
184 pub EthereumNetwork: NetworkId = NetworkId::Ethereum { chain_id: 11155111 };
189 pub EthereumLocation: Location = Location::new(2, EthereumNetwork::get());
190 pub AssetHubParaId: ParaId = ParaId::from(westend_runtime_constants::system_parachain::ASSET_HUB_ID);
191 }
192}
193
194pub mod xcm_version {
195 pub const SAFE_XCM_VERSION: u32 = xcm::prelude::XCM_VERSION;
197}
198
199pub mod locations {
200 use frame_support::parameter_types;
201 pub use westend_runtime_constants::system_parachain::{AssetHubParaId, PeopleParaId};
202 use xcm::latest::prelude::{Location, Parachain};
203
204 parameter_types! {
205 pub AssetHubLocation: Location = Location::new(1, Parachain(westend_runtime_constants::system_parachain::ASSET_HUB_ID));
206 pub PeopleLocation: Location = Location::new(1, Parachain(westend_runtime_constants::system_parachain::PEOPLE_ID));
207 }
208
209 pub type GovernanceLocation = AssetHubLocation;
211}