testnets_common/
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}
33
34pub mod currency {
35 use polkadot_core_primitives::Balance;
36 use westend_runtime_constants as constants;
37
38 pub const EXISTENTIAL_DEPOSIT: Balance = constants::currency::EXISTENTIAL_DEPOSIT / 10;
40
41 pub const UNITS: Balance = constants::currency::UNITS;
42 pub const DOLLARS: Balance = UNITS; pub const CENTS: Balance = constants::currency::CENTS;
44 pub const MILLICENTS: Balance = constants::currency::MILLICENTS;
45 pub const GRAND: Balance = constants::currency::GRAND;
46
47 pub const fn deposit(items: u32, bytes: u32) -> Balance {
48 constants::currency::deposit(items, bytes) / 100
50 }
51}
52
53pub mod fee {
55 use frame_support::{
56 pallet_prelude::Weight,
57 weights::{
58 constants::ExtrinsicBaseWeight, FeePolynomial, WeightToFeeCoefficient,
59 WeightToFeeCoefficients, WeightToFeePolynomial,
60 },
61 };
62 use polkadot_core_primitives::Balance;
63 use smallvec::smallvec;
64 pub use sp_runtime::Perbill;
65
66 pub const TARGET_BLOCK_FULLNESS: Perbill = Perbill::from_percent(25);
68
69 pub struct WeightToFee;
80 impl frame_support::weights::WeightToFee for WeightToFee {
81 type Balance = Balance;
82
83 fn weight_to_fee(weight: &Weight) -> Self::Balance {
84 let time_poly: FeePolynomial<Balance> = RefTimeToFee::polynomial().into();
85 let proof_poly: FeePolynomial<Balance> = ProofSizeToFee::polynomial().into();
86
87 time_poly.eval(weight.ref_time()).max(proof_poly.eval(weight.proof_size()))
89 }
90 }
91
92 pub struct RefTimeToFee;
94 impl WeightToFeePolynomial for RefTimeToFee {
95 type Balance = Balance;
96 fn polynomial() -> WeightToFeeCoefficients<Self::Balance> {
97 let p = super::currency::CENTS;
100 let q = 100 * Balance::from(ExtrinsicBaseWeight::get().ref_time());
101
102 smallvec![WeightToFeeCoefficient {
103 degree: 1,
104 negative: false,
105 coeff_frac: Perbill::from_rational(p % q, q),
106 coeff_integer: p / q,
107 }]
108 }
109 }
110
111 pub struct ProofSizeToFee;
113 impl WeightToFeePolynomial for ProofSizeToFee {
114 type Balance = Balance;
115 fn polynomial() -> WeightToFeeCoefficients<Self::Balance> {
116 let p = super::currency::CENTS;
118 let q = 10_000;
119
120 smallvec![WeightToFeeCoefficient {
121 degree: 1,
122 negative: false,
123 coeff_frac: Perbill::from_rational(p % q, q),
124 coeff_integer: p / q,
125 }]
126 }
127 }
128}
129
130pub mod consensus {
132 pub const UNINCLUDED_SEGMENT_CAPACITY: u32 = 1;
135 pub const BLOCK_PROCESSING_VELOCITY: u32 = 1;
138 pub const RELAY_CHAIN_SLOT_DURATION_MILLIS: u32 = 6000;
140}