1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
use super::*;
use crate::CurrencyId::ForeignAsset;
use codec::{Decode, Encode};
use cumulus_primitives_core::ParaId;
use frame_support::{
parameter_types,
traits::{Everything, Get, Nothing},
};
use orml_asset_registry::{AssetRegistryTrader, FixedRateAssetRegistryTrader};
use orml_traits::{
location::AbsoluteReserveProvider, parameter_type_with_key, FixedConversionRateProvider, MultiCurrency,
};
use orml_xcm_support::{DepositToAlternative, IsNativeConcrete, MultiCurrencyAdapter, MultiNativeAsset};
use pallet_xcm::XcmPassthrough;
use polkadot_parachain::primitives::Sibling;
use runtime_common::Transactless;
use xcm::latest::{prelude::*, Weight};
use xcm_builder::{
AccountId32Aliases, AllowKnownQueryResponses, AllowSubscriptionsFrom, AllowTopLevelPaidExecutionFrom,
EnsureXcmOrigin, FixedRateOfFungible, FixedWeightBounds, ParentIsPreset, RelayChainAsNative,
SiblingParachainAsNative, SiblingParachainConvertsVia, SignedAccountId32AsNative, SignedToAccountId32,
SovereignSignedViaLocation, TakeRevenue, TakeWeightCredit,
};
pub use xcm_executor;
use xcm_executor::{traits::WithOriginFilter, XcmExecutor};
parameter_types! {
pub const ParentLocation: MultiLocation = MultiLocation::parent();
pub const ParentNetwork: NetworkId = NetworkId::Kusama;
pub RelayChainOrigin: RuntimeOrigin = cumulus_pallet_xcm::Origin::Relay.into();
pub Ancestry: MultiLocation = Parachain(ParachainInfo::parachain_id().into()).into();
}
type LocationToAccountId = (
ParentIsPreset<AccountId>,
SiblingParachainConvertsVia<Sibling, AccountId>,
AccountId32Aliases<ParentNetwork, AccountId>,
);
pub type XcmOriginToTransactDispatchOrigin = (
SovereignSignedViaLocation<LocationToAccountId, RuntimeOrigin>,
RelayChainAsNative<RelayChainOrigin, RuntimeOrigin>,
SiblingParachainAsNative<cumulus_pallet_xcm::Origin, RuntimeOrigin>,
SignedAccountId32AsNative<ParentNetwork, RuntimeOrigin>,
XcmPassthrough<RuntimeOrigin>,
);
pub type Barrier = Transactless<(
TakeWeightCredit,
AllowTopLevelPaidExecutionFrom<Everything>,
AllowKnownQueryResponses<PolkadotXcm>,
AllowSubscriptionsFrom<Everything>,
)>; parameter_types! {
pub UnitWeightCost: Weight = Weight::from_parts(200_000_000, 0u64);
pub const MaxInstructions: u32 = 100;
}
pub struct XcmConfig;
fn base_tx_in_dot() -> Balance {
DOT.one() / 5706 }
pub fn dot_per_second() -> u128 {
let base_weight = Balance::from(ExtrinsicBaseWeight::get().ref_time());
let base_tx_per_second = (WEIGHT_REF_TIME_PER_SECOND as u128) / base_weight;
base_tx_per_second * base_tx_in_dot()
}
parameter_types! {
pub DotPerSecond: (AssetId, u128, u128) = (MultiLocation::parent().into(), dot_per_second(),
0, );
pub CanonicalizedIntrPerSecond: (AssetId, u128, u128) = (
canonical_currency_location(Token(INTR)).into(),
(dot_per_second() * 4) / 3,
0, );
pub CanonicalizedIbtcPerSecond: (AssetId, u128, u128) = (
canonical_currency_location(Token(IBTC)).into(),
dot_per_second() / 226_600,
0, );
pub IntrPerSecond: (AssetId, u128, u128) = ( non_canonical_currency_location(Token(INTR)).into(),
(dot_per_second() * 4) / 3,
0, );
pub IbtcPerSecond: (AssetId, u128, u128) = (
non_canonical_currency_location(Token(IBTC)).into(),
dot_per_second() / 226_600,
0, );
pub const RelayNetwork: NetworkId = NetworkId::Polkadot;
pub UniversalLocation: InteriorMultiLocation = X2(GlobalConsensus(RelayNetwork::get()), Parachain(ParachainInfo::parachain_id().into()));
pub const MaxAssetsIntoHolding: u32 = 8;
}
pub struct ToAuthor;
impl TakeRevenue for ToAuthor {
fn take_revenue(revenue: MultiAsset) {
if let MultiAsset {
id: Concrete(location),
fun: Fungible(amount),
} = revenue
{
if let Some(currency_id) = CurrencyIdConvert::convert(location) {
if let Some(author) = pallet_authorship::Pallet::<Runtime>::author() {
let _ = Tokens::deposit(currency_id, &author, amount);
} else {
let _ = Tokens::deposit(currency_id, &TreasuryAccount::get(), amount);
}
}
}
}
}
pub type Trader = (
FixedRateOfFungible<DotPerSecond, ToAuthor>,
FixedRateOfFungible<CanonicalizedIntrPerSecond, ToAuthor>,
FixedRateOfFungible<CanonicalizedIbtcPerSecond, ToAuthor>,
FixedRateOfFungible<IntrPerSecond, ToAuthor>,
FixedRateOfFungible<IbtcPerSecond, ToAuthor>,
AssetRegistryTrader<FixedRateAssetRegistryTrader<MyFixedConversionRateProvider>, ToAuthor>,
);
pub struct MyFixedConversionRateProvider;
impl FixedConversionRateProvider for MyFixedConversionRateProvider {
fn get_fee_per_second(location: &MultiLocation) -> Option<u128> {
let metadata = AssetRegistry::fetch_metadata_by_location(location)?;
Some(metadata.additional.fee_per_second)
}
}
pub struct SafeCallFilter;
impl Contains<RuntimeCall> for SafeCallFilter {
fn contains(call: &RuntimeCall) -> bool {
match call {
RuntimeCall::Sudo(..) | RuntimeCall::Proxy(..) | RuntimeCall::Multisig(..) | RuntimeCall::Utility(..) => {
false
}
RuntimeCall::Issue(..) | RuntimeCall::Replace(..) | RuntimeCall::Redeem(..) | RuntimeCall::BTCRelay(..) => {
false
}
_ => true,
}
}
}
impl xcm_executor::Config for XcmConfig {
type RuntimeCall = RuntimeCall;
type XcmSender = XcmRouter;
#[cfg(feature = "runtime-benchmarks")]
type AssetTransactor = BenchmarkingLocalAssetTransactor;
#[cfg(not(feature = "runtime-benchmarks"))]
type AssetTransactor = LocalAssetTransactor;
type OriginConverter = XcmOriginToTransactDispatchOrigin;
type IsReserve = MultiNativeAsset<AbsoluteReserveProvider>;
type IsTeleporter = Nothing; type Barrier = Barrier;
type Weigher = FixedWeightBounds<UnitWeightCost, RuntimeCall, MaxInstructions>;
type Trader = Trader;
type ResponseHandler = PolkadotXcm;
type SubscriptionService = PolkadotXcm;
type AssetTrap = PolkadotXcm;
type AssetClaims = PolkadotXcm;
type PalletInstancesInfo = AllPalletsWithSystem;
type MaxAssetsIntoHolding = MaxAssetsIntoHolding;
type AssetLocker = ();
type AssetExchanger = ();
type FeeManager = ();
type MessageExporter = ();
type UniversalAliases = Nothing;
type SafeCallFilter = SafeCallFilter;
type CallDispatcher = WithOriginFilter<SafeCallFilter>;
type UniversalLocation = UniversalLocation;
type Aliasers = Nothing;
}
pub type LocalOriginToLocation = (SignedToAccountId32<RuntimeOrigin, AccountId, ParentNetwork>,);
pub type XcmRouter = (
cumulus_primitives_utility::ParentAsUmp<ParachainSystem, PolkadotXcm, ()>, XcmpQueue,
);
#[cfg(feature = "runtime-benchmarks")]
parameter_types! {
pub const ReachableDest: MultiLocation = MultiLocation::parent();
}
impl pallet_xcm::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type RuntimeCall = RuntimeCall;
type RuntimeOrigin = RuntimeOrigin;
type SendXcmOrigin = EnsureXcmOrigin<RuntimeOrigin, LocalOriginToLocation>;
type XcmRouter = XcmRouter;
type ExecuteXcmOrigin = EnsureXcmOrigin<RuntimeOrigin, LocalOriginToLocation>;
type XcmExecuteFilter = Nothing;
type XcmExecutor = XcmExecutor<XcmConfig>;
type XcmTeleportFilter = Everything;
type XcmReserveTransferFilter = Everything;
type Weigher = FixedWeightBounds<UnitWeightCost, RuntimeCall, MaxInstructions>;
type AdvertisedXcmVersion = pallet_xcm::CurrentXcmVersion;
const VERSION_DISCOVERY_QUEUE_SIZE: u32 = 100;
type Currency = NativeCurrency; type CurrencyMatcher = ();
type TrustedLockers = ();
type SovereignAccountOf = LocationToAccountId;
type MaxLockers = ConstU32<8>;
type UniversalLocation = UniversalLocation;
type WeightInfo = pallet_xcm::TestWeightInfo; #[cfg(feature = "runtime-benchmarks")]
type ReachableDest = ReachableDest;
type AdminOrigin = EnsureRoot<AccountId>;
type MaxRemoteLockConsumers = ConstU32<0>;
type RemoteLockConsumerIdentifier = ();
}
impl cumulus_pallet_xcm::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type XcmExecutor = XcmExecutor<XcmConfig>;
}
impl cumulus_pallet_xcmp_queue::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type XcmExecutor = XcmExecutor<XcmConfig>;
type ChannelInfo = ParachainSystem;
type VersionWrapper = PolkadotXcm;
type ExecuteOverweightOrigin = EnsureRoot<AccountId>;
type ControllerOrigin = EnsureRoot<AccountId>;
type ControllerOriginConverter = XcmOriginToTransactDispatchOrigin;
type PriceForSiblingDelivery = ();
type WeightInfo = weights::cumulus_pallet_xcmp_queue::WeightInfo<Runtime>;
}
impl cumulus_pallet_dmp_queue::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type XcmExecutor = XcmExecutor<XcmConfig>;
type ExecuteOverweightOrigin = frame_system::EnsureRoot<AccountId>;
}
pub type LocalAssetTransactor = MultiCurrencyAdapter<
Tokens,
UnknownTokens,
IsNativeConcrete<CurrencyId, CurrencyIdConvert>,
AccountId,
LocationToAccountId,
CurrencyId,
CurrencyIdConvert,
DepositToAlternative<TreasuryAccount, Tokens, CurrencyId, AccountId, Balance>,
>;
fn general_key_of(id: CurrencyId) -> Junction {
let encoded = id.encode();
let mut data = [0u8; 32];
if encoded.len() > 32 {
panic!("Currency ID was too long to be encoded");
}
data[..encoded.len()].copy_from_slice(&encoded[..]);
GeneralKey {
length: encoded.len() as u8,
data,
}
}
pub fn canonical_currency_location(id: CurrencyId) -> MultiLocation {
MultiLocation::new(0, X1(general_key_of(id)))
}
pub fn non_canonical_currency_location(id: CurrencyId) -> MultiLocation {
MultiLocation::new(1, X2(Parachain(ParachainInfo::get().into()), general_key_of(id)))
}
pub use currency_id_convert::CurrencyIdConvert;
mod currency_id_convert {
use super::*;
pub struct CurrencyIdConvert;
impl Convert<CurrencyId, Option<MultiLocation>> for CurrencyIdConvert {
fn convert(id: CurrencyId) -> Option<MultiLocation> {
match id {
PARENT_CURRENCY_ID => Some(MultiLocation::parent()),
WRAPPED_CURRENCY_ID => Some(non_canonical_currency_location(id)),
NATIVE_CURRENCY_ID => Some(non_canonical_currency_location(id)),
ForeignAsset(id) => AssetRegistry::multilocation(&id).unwrap_or_default(),
_ => None,
}
}
}
impl Convert<MultiLocation, Option<CurrencyId>> for CurrencyIdConvert {
fn convert(location: MultiLocation) -> Option<CurrencyId> {
fn decode_currency_id(length: u8, data: [u8; 32]) -> Option<CurrencyId> {
let length = length as usize;
if length > data.len() {
return None;
}
if let Ok(currency_id) = CurrencyId::decode(&mut &data[..length]) {
match currency_id {
WRAPPED_CURRENCY_ID => Some(currency_id),
NATIVE_CURRENCY_ID => Some(currency_id),
_ => None,
}
} else {
None
}
}
match location.clone() {
x if x == MultiLocation::parent() => Some(PARENT_CURRENCY_ID),
MultiLocation {
parents: 1,
interior: X2(Parachain(id), GeneralKey { length, data }),
} if ParaId::from(id) == ParachainInfo::get() => decode_currency_id(length, data),
MultiLocation {
parents: 0,
interior: X1(GeneralKey { length, data }),
} => decode_currency_id(length, data),
_ => None,
}
.or_else(|| AssetRegistry::location_to_asset_id(&location).map(|id| CurrencyId::ForeignAsset(id)))
}
}
impl Convert<MultiAsset, Option<CurrencyId>> for CurrencyIdConvert {
fn convert(asset: MultiAsset) -> Option<CurrencyId> {
if let MultiAsset {
id: Concrete(location), ..
} = asset
{
Self::convert(location)
} else {
None
}
}
}
}
parameter_types! {
pub SelfLocation: MultiLocation = MultiLocation::new(1, X1(Parachain(ParachainInfo::get().into())));
pub const MaxAssetsForTransfer: usize = 2; }
const STATEMINT_PARA_ID: u32 = 1000;
const STATEMINT_XCM_FEE: u128 = 500_000_000; parameter_type_with_key! {
pub ParachainMinFee: |location: MultiLocation| -> Option<u128> {
#[allow(clippy::match_ref_pats)] match (location.parents, location.first_interior()) {
(1, Some(Parachain(id))) if *id == STATEMINT_PARA_ID => Some(STATEMINT_XCM_FEE),
_ => None,
}
};
}
pub struct AccountIdToMultiLocation;
impl Convert<AccountId, MultiLocation> for AccountIdToMultiLocation {
fn convert(account: AccountId) -> MultiLocation {
X1(AccountId32 {
network: None,
id: account.into(),
})
.into()
}
}
impl orml_xtokens::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type Balance = Balance;
type CurrencyId = CurrencyId;
type CurrencyIdConvert = CurrencyIdConvert;
type AccountIdToMultiLocation = AccountIdToMultiLocation;
type SelfLocation = SelfLocation;
type XcmExecutor = XcmExecutor<XcmConfig>;
type Weigher = FixedWeightBounds<UnitWeightCost, RuntimeCall, MaxInstructions>;
type BaseXcmWeight = UnitWeightCost;
type MaxAssetsForTransfer = MaxAssetsForTransfer;
type MinXcmFee = ParachainMinFee;
type MultiLocationsFilter = Everything;
type ReserveProvider = AbsoluteReserveProvider;
type UniversalLocation = UniversalLocation;
}
#[cfg(feature = "runtime-benchmarks")]
use benchmark_impls::*;
#[cfg(feature = "runtime-benchmarks")]
mod benchmark_impls {
use super::*;
use frame_benchmarking::BenchmarkError;
pub struct BenchmarkingLocalAssetTransactor;
#[cfg(feature = "runtime-benchmarks")]
impl xcm_executor::traits::TransactAsset for BenchmarkingLocalAssetTransactor {
fn can_check_in(_origin: &MultiLocation, _what: &MultiAsset, _context: &XcmContext) -> XcmResult {
Ok(())
}
fn check_in(_origin: &MultiLocation, _what: &MultiAsset, _context: &XcmContext) {}
fn can_check_out(_dest: &MultiLocation, _what: &MultiAsset, _context: &XcmContext) -> XcmResult {
Ok(())
}
fn check_out(_dest: &MultiLocation, _what: &MultiAsset, _context: &XcmContext) {}
fn deposit_asset(what: &MultiAsset, who: &MultiLocation, context: &XcmContext) -> XcmResult {
LocalAssetTransactor::deposit_asset(what, who, context)
}
fn withdraw_asset(
what: &MultiAsset,
who: &MultiLocation,
maybe_context: Option<&XcmContext>,
) -> Result<xcm_executor::Assets, XcmError> {
LocalAssetTransactor::withdraw_asset(what, who, maybe_context)
}
fn internal_transfer_asset(
asset: &MultiAsset,
from: &MultiLocation,
to: &MultiLocation,
context: &XcmContext,
) -> Result<xcm_executor::Assets, XcmError> {
LocalAssetTransactor::internal_transfer_asset(asset, from, to, context)
}
fn transfer_asset(
asset: &MultiAsset,
from: &MultiLocation,
to: &MultiLocation,
context: &XcmContext,
) -> Result<xcm_executor::Assets, XcmError> {
LocalAssetTransactor::transfer_asset(asset, from, to, context)
}
}
impl pallet_xcm_benchmarks::Config for Runtime {
type XcmConfig = XcmConfig;
type AccountIdConverter = xcm_config::LocationToAccountId;
fn valid_destination() -> Result<MultiLocation, BenchmarkError> {
Ok(MultiLocation::parent())
}
fn worst_case_holding(_depositable_count: u32) -> MultiAssets {
const HOLDING_FUNGIBLES: u32 = 9;
let fungibles_amount: u128 = 100;
let assets = (0..HOLDING_FUNGIBLES)
.map(|i| {
let location: MultiLocation = GeneralIndex(i as u128).into();
MultiAsset {
id: Concrete(location),
fun: Fungible(fungibles_amount * i as u128),
}
.into()
})
.chain(core::iter::once(MultiAsset {
id: Concrete(MultiLocation::parent()),
fun: Fungible(u128::MAX),
}))
.collect::<Vec<_>>();
assets.into()
}
}
parameter_types! {
pub TrustedTeleporter: Option<(MultiLocation, MultiAsset)> = None;
pub CheckedAccount: Option<(AccountId, xcm_builder::MintLocation)> = None;
}
impl pallet_xcm_benchmarks::fungible::Config for Runtime {
type TransactAsset = orml_tokens::CurrencyAdapter<Runtime, GetNativeCurrencyId>;
type CheckedAccount = CheckedAccount;
type TrustedTeleporter = TrustedTeleporter;
fn get_multi_asset() -> MultiAsset {
MultiAsset {
id: Concrete(canonical_currency_location(Token(INTR))),
fun: Fungible(100000000000),
}
}
}
impl pallet_xcm_benchmarks::generic::Config for Runtime {
type RuntimeCall = RuntimeCall;
fn worst_case_response() -> (u64, Response) {
(0u64, Response::Version(Default::default()))
}
fn worst_case_asset_exchange() -> Result<(MultiAssets, MultiAssets), BenchmarkError> {
Err(BenchmarkError::Skip)
}
fn universal_alias() -> Result<(MultiLocation, Junction), BenchmarkError> {
Err(BenchmarkError::Skip)
}
fn transact_origin_and_runtime_call() -> Result<(MultiLocation, RuntimeCall), BenchmarkError> {
let origin = MultiLocation::parent();
let call = RuntimeCall::System(frame_system::Call::remark { remark: vec![] });
Ok((origin, call))
}
fn subscribe_origin() -> Result<MultiLocation, BenchmarkError> {
Ok(MultiLocation::parent())
}
fn claimable_asset() -> Result<(MultiLocation, MultiLocation, MultiAssets), BenchmarkError> {
let origin = MultiLocation::parent();
let assets: MultiAssets = (Concrete(MultiLocation::parent()), 1_000u128).into();
let ticket = MultiLocation {
parents: 0,
interior: Here,
};
Ok((origin, ticket, assets))
}
fn unlockable_asset() -> Result<(MultiLocation, MultiLocation, MultiAsset), BenchmarkError> {
Err(BenchmarkError::Skip)
}
fn export_message_origin_and_destination(
) -> Result<(MultiLocation, NetworkId, InteriorMultiLocation), BenchmarkError> {
Err(BenchmarkError::Skip)
}
fn alias_origin() -> Result<(MultiLocation, MultiLocation), BenchmarkError> {
Err(BenchmarkError::Skip)
}
}
}
#[cfg(test)]
mod tests {
use super::*;
type FungiblesWeight = crate::weights::pallet_xcm_benchmarks_fungible::WeightInfo<Runtime>;
type GenericsWeight = crate::weights::pallet_xcm_benchmarks_generic::WeightInfo<Runtime>;
fn check_assets_weight(weight: Weight) {
let unit_weight_cost = UnitWeightCost::get();
let holding_items: u64 = MaxAssetsIntoHolding::get().into();
assert!(weight.ref_time() * holding_items * 2 <= unit_weight_cost.ref_time());
}
#[test]
#[ignore] fn test_weights() {
let unit_weight_cost = UnitWeightCost::get();
check_assets_weight(FungiblesWeight::withdraw_asset());
check_assets_weight(FungiblesWeight::transfer_asset());
check_assets_weight(FungiblesWeight::transfer_reserve_asset());
check_assets_weight(FungiblesWeight::deposit_asset());
check_assets_weight(FungiblesWeight::deposit_reserve_asset());
check_assets_weight(GenericsWeight::burn_asset());
check_assets_weight(GenericsWeight::expect_asset());
assert!(GenericsWeight::clear_origin().ref_time() <= unit_weight_cost.ref_time());
assert!(GenericsWeight::descend_origin().ref_time() <= unit_weight_cost.ref_time());
assert!(GenericsWeight::report_error().ref_time() <= unit_weight_cost.ref_time());
assert!(GenericsWeight::report_holding().ref_time() <= unit_weight_cost.ref_time());
assert!(GenericsWeight::buy_execution().ref_time() <= unit_weight_cost.ref_time());
assert!(GenericsWeight::refund_surplus().ref_time() <= unit_weight_cost.ref_time());
assert!(GenericsWeight::set_error_handler().ref_time() <= unit_weight_cost.ref_time());
assert!(GenericsWeight::set_appendix().ref_time() <= unit_weight_cost.ref_time());
assert!(GenericsWeight::clear_error().ref_time() <= unit_weight_cost.ref_time());
assert!(GenericsWeight::claim_asset().ref_time() <= unit_weight_cost.ref_time());
assert!(GenericsWeight::trap().ref_time() <= unit_weight_cost.ref_time());
assert!(GenericsWeight::subscribe_version().ref_time() <= unit_weight_cost.ref_time());
assert!(GenericsWeight::unsubscribe_version().ref_time() <= unit_weight_cost.ref_time());
assert!(GenericsWeight::expect_origin().ref_time() <= unit_weight_cost.ref_time());
assert!(GenericsWeight::expect_error().ref_time() <= unit_weight_cost.ref_time());
assert!(GenericsWeight::expect_transact_status().ref_time() <= unit_weight_cost.ref_time());
assert!(GenericsWeight::query_response().ref_time() <= unit_weight_cost.ref_time());
assert!(GenericsWeight::query_pallet().ref_time() <= unit_weight_cost.ref_time());
assert!(GenericsWeight::expect_pallet().ref_time() <= unit_weight_cost.ref_time());
assert!(GenericsWeight::report_transact_status().ref_time() <= unit_weight_cost.ref_time());
assert!(GenericsWeight::clear_transact_status().ref_time() <= unit_weight_cost.ref_time());
assert!(GenericsWeight::set_fees_mode().ref_time() <= unit_weight_cost.ref_time());
assert!(GenericsWeight::set_topic().ref_time() <= unit_weight_cost.ref_time());
assert!(GenericsWeight::clear_topic().ref_time() <= unit_weight_cost.ref_time());
assert!(GenericsWeight::unpaid_execution().ref_time() <= unit_weight_cost.ref_time());
}
}