File tree 2 files changed +10
-1
lines changed
2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -89,6 +89,13 @@ pub mod module {
89
89
90
90
/// Means of measuring the weight consumed by an XCM message locally.
91
91
type Weigher : WeightBounds < Self :: Call > ;
92
+
93
+ /// Base XCM weight.
94
+ ///
95
+ /// The actually weight for an XCM message is `T::BaseXcmWeight +
96
+ /// T::Weigher::weight(&msg)`.
97
+ #[ pallet:: constant]
98
+ type BaseXcmWeight : Get < Weight > ;
92
99
}
93
100
94
101
#[ pallet:: event]
@@ -376,7 +383,7 @@ pub mod module {
376
383
}
377
384
}
378
385
} ;
379
- T :: Weigher :: weight ( & mut msg) . map_or ( Weight :: max_value ( ) , |w| 100_000_000 + w )
386
+ T :: Weigher :: weight ( & mut msg) . map_or ( Weight :: max_value ( ) , |w| T :: BaseXcmWeight :: get ( ) . saturating_add ( w ) )
380
387
} else {
381
388
0
382
389
}
Original file line number Diff line number Diff line change @@ -216,6 +216,7 @@ impl Convert<AccountId, MultiLocation> for AccountIdToMultiLocation {
216
216
217
217
parameter_types ! {
218
218
pub SelfLocation : MultiLocation = X2 ( Parent , Parachain ( ParachainInfo :: get( ) . into( ) ) ) ;
219
+ pub const BaseXcmWeight : Weight = 100_000_000 ;
219
220
}
220
221
221
222
impl orml_xtokens:: Config for Runtime {
@@ -227,6 +228,7 @@ impl orml_xtokens::Config for Runtime {
227
228
type SelfLocation = SelfLocation ;
228
229
type XcmExecutor = XcmExecutor < XcmConfig > ;
229
230
type Weigher = FixedWeightBounds < UnitWeightCost , Call > ;
231
+ type BaseXcmWeight = BaseXcmWeight ;
230
232
}
231
233
232
234
type UncheckedExtrinsic = frame_system:: mocking:: MockUncheckedExtrinsic < Runtime > ;
You can’t perform that action at this time.
0 commit comments