@@ -108,7 +108,7 @@ use xcm::{
108
108
use xcm_builder:: PayOverXcm ;
109
109
110
110
use xcm_executor:: traits:: WeightBounds ;
111
- use xcm_payment_runtime_api:: Error as XcmPaymentError ;
111
+ use xcm_payment_runtime_api:: Error as XcmPaymentApiError ;
112
112
113
113
pub use frame_system:: Call as SystemCall ;
114
114
pub use pallet_balances:: Call as BalancesCall ;
@@ -441,10 +441,12 @@ impl OpaqueKeys for OldSessionKeys {
441
441
<<Babe as BoundToRuntimeAppPublic >:: Public >:: ID => self . babe . as_ref ( ) ,
442
442
sp_core:: crypto:: key_types:: IM_ONLINE => self . im_online . as_ref ( ) ,
443
443
<<Initializer as BoundToRuntimeAppPublic >:: Public >:: ID => self . para_validator . as_ref ( ) ,
444
- <<ParaSessionInfo as BoundToRuntimeAppPublic >:: Public >:: ID =>
445
- self . para_assignment . as_ref ( ) ,
446
- <<AuthorityDiscovery as BoundToRuntimeAppPublic >:: Public >:: ID =>
447
- self . authority_discovery . as_ref ( ) ,
444
+ <<ParaSessionInfo as BoundToRuntimeAppPublic >:: Public >:: ID => {
445
+ self . para_assignment . as_ref ( )
446
+ } ,
447
+ <<AuthorityDiscovery as BoundToRuntimeAppPublic >:: Public >:: ID => {
448
+ self . authority_discovery . as_ref ( )
449
+ } ,
448
450
<<Beefy as BoundToRuntimeAppPublic >:: Public >:: ID => self . beefy . as_ref ( ) ,
449
451
_ => & [ ] ,
450
452
}
@@ -1050,11 +1052,12 @@ impl InstanceFilter<RuntimeCall> for ProxyType {
1050
1052
ProxyType :: Staking => {
1051
1053
matches ! (
1052
1054
c,
1053
- RuntimeCall :: Staking ( ..) |
1054
- RuntimeCall :: Session ( ..) | RuntimeCall :: Utility ( ..) |
1055
- RuntimeCall :: FastUnstake ( ..) |
1056
- RuntimeCall :: VoterList ( ..) |
1057
- RuntimeCall :: NominationPools ( ..)
1055
+ RuntimeCall :: Staking ( ..)
1056
+ | RuntimeCall :: Session ( ..)
1057
+ | RuntimeCall :: Utility ( ..)
1058
+ | RuntimeCall :: FastUnstake ( ..)
1059
+ | RuntimeCall :: VoterList ( ..)
1060
+ | RuntimeCall :: NominationPools ( ..)
1058
1061
)
1059
1062
} ,
1060
1063
ProxyType :: NominationPools => {
@@ -1070,24 +1073,24 @@ impl InstanceFilter<RuntimeCall> for ProxyType {
1070
1073
ProxyType :: Governance => matches ! (
1071
1074
c,
1072
1075
// OpenGov calls
1073
- RuntimeCall :: ConvictionVoting ( ..) |
1074
- RuntimeCall :: Referenda ( ..) |
1075
- RuntimeCall :: Whitelist ( ..)
1076
+ RuntimeCall :: ConvictionVoting ( ..)
1077
+ | RuntimeCall :: Referenda ( ..)
1078
+ | RuntimeCall :: Whitelist ( ..)
1076
1079
) ,
1077
1080
ProxyType :: IdentityJudgement => matches ! (
1078
1081
c,
1079
- RuntimeCall :: Identity ( pallet_identity:: Call :: provide_judgement { .. } ) |
1080
- RuntimeCall :: Utility ( ..)
1082
+ RuntimeCall :: Identity ( pallet_identity:: Call :: provide_judgement { .. } )
1083
+ | RuntimeCall :: Utility ( ..)
1081
1084
) ,
1082
1085
ProxyType :: CancelProxy => {
1083
1086
matches ! ( c, RuntimeCall :: Proxy ( pallet_proxy:: Call :: reject_announcement { .. } ) )
1084
1087
} ,
1085
1088
ProxyType :: Auction => matches ! (
1086
1089
c,
1087
- RuntimeCall :: Auctions ( ..) |
1088
- RuntimeCall :: Crowdloan ( ..) |
1089
- RuntimeCall :: Registrar ( ..) |
1090
- RuntimeCall :: Slots ( ..)
1090
+ RuntimeCall :: Auctions ( ..)
1091
+ | RuntimeCall :: Crowdloan ( ..)
1092
+ | RuntimeCall :: Registrar ( ..)
1093
+ | RuntimeCall :: Slots ( ..)
1091
1094
) ,
1092
1095
}
1093
1096
}
@@ -1593,11 +1596,11 @@ pub mod migrations {
1593
1596
let now = frame_system:: Pallet :: < Runtime > :: block_number ( ) ;
1594
1597
let lease = slots:: Pallet :: < Runtime > :: lease ( para) ;
1595
1598
if lease. is_empty ( ) {
1596
- return None
1599
+ return None ;
1597
1600
}
1598
1601
// Lease not yet started, ignore:
1599
1602
if lease. iter ( ) . any ( Option :: is_none) {
1600
- return None
1603
+ return None ;
1601
1604
}
1602
1605
let ( index, _) =
1603
1606
<slots:: Pallet < Runtime > as Leaser < BlockNumber > >:: lease_period_index ( now) ?;
@@ -1619,7 +1622,7 @@ pub mod migrations {
1619
1622
fn pre_upgrade ( ) -> Result < sp_std:: vec:: Vec < u8 > , sp_runtime:: TryRuntimeError > {
1620
1623
if System :: last_runtime_upgrade_spec_version ( ) > UPGRADE_SESSION_KEYS_FROM_SPEC {
1621
1624
log:: warn!( target: "runtime::session_keys" , "Skipping session keys migration pre-upgrade check due to spec version (already applied?)" ) ;
1622
- return Ok ( Vec :: new ( ) )
1625
+ return Ok ( Vec :: new ( ) ) ;
1623
1626
}
1624
1627
1625
1628
log:: info!( target: "runtime::session_keys" , "Collecting pre-upgrade session keys state" ) ;
@@ -1648,7 +1651,7 @@ pub mod migrations {
1648
1651
fn on_runtime_upgrade ( ) -> Weight {
1649
1652
if System :: last_runtime_upgrade_spec_version ( ) > UPGRADE_SESSION_KEYS_FROM_SPEC {
1650
1653
log:: warn!( "Skipping session keys upgrade: already applied" ) ;
1651
- return <Runtime as frame_system:: Config >:: DbWeight :: get ( ) . reads ( 1 )
1654
+ return <Runtime as frame_system:: Config >:: DbWeight :: get ( ) . reads ( 1 ) ;
1652
1655
}
1653
1656
log:: info!( "Upgrading session keys" ) ;
1654
1657
Session :: upgrade_keys :: < OldSessionKeys , _ > ( transform_session_keys) ;
@@ -1661,7 +1664,7 @@ pub mod migrations {
1661
1664
) -> Result < ( ) , sp_runtime:: TryRuntimeError > {
1662
1665
if System :: last_runtime_upgrade_spec_version ( ) > UPGRADE_SESSION_KEYS_FROM_SPEC {
1663
1666
log:: warn!( target: "runtime::session_keys" , "Skipping session keys migration post-upgrade check due to spec version (already applied?)" ) ;
1664
- return Ok ( ( ) )
1667
+ return Ok ( ( ) ) ;
1665
1668
}
1666
1669
1667
1670
let key_ids = SessionKeys :: key_ids ( ) ;
@@ -2257,33 +2260,33 @@ sp_api::impl_runtime_apis! {
2257
2260
}
2258
2261
2259
2262
impl xcm_payment_runtime_api:: XcmPaymentApi <Block , RuntimeCall > for Runtime {
2260
- fn query_acceptable_payment_assets( xcm_version: xcm:: Version ) -> Result <Vec <VersionedAssetId >, XcmPaymentError > {
2263
+ fn query_acceptable_payment_assets( xcm_version: xcm:: Version ) -> Result <Vec <VersionedAssetId >, XcmPaymentApiError > {
2261
2264
if !matches!( xcm_version, 3 | 4 ) {
2262
- return Err ( XcmPaymentError :: UnhandledXcmVersion ) ;
2265
+ return Err ( XcmPaymentApiError :: UnhandledXcmVersion ) ;
2263
2266
}
2264
2267
Ok ( [ VersionedAssetId :: V4 ( xcm_config:: TokenLocation :: get( ) . into( ) ) ]
2265
2268
. into_iter( )
2266
2269
. filter_map( |asset| asset. into_version( xcm_version) . ok( ) )
2267
2270
. collect( ) )
2268
2271
}
2269
2272
2270
- fn query_weight_to_asset_fee( weight: Weight , asset: VersionedAssetId ) -> Result <u128 , XcmPaymentError > {
2273
+ fn query_weight_to_asset_fee( weight: Weight , asset: VersionedAssetId ) -> Result <u128 , XcmPaymentApiError > {
2271
2274
let local_asset = VersionedAssetId :: V4 ( xcm_config:: TokenLocation :: get( ) . into( ) ) ;
2272
2275
let asset = asset
2273
2276
. into_version( 4 )
2274
- . map_err( |_| XcmPaymentError :: VersionedConversionFailed ) ?;
2277
+ . map_err( |_| XcmPaymentApiError :: VersionedConversionFailed ) ?;
2275
2278
2276
- if asset != local_asset { return Err ( XcmPaymentError :: AssetNotFound ) ; }
2279
+ if asset != local_asset { return Err ( XcmPaymentApiError :: AssetNotFound ) ; }
2277
2280
2278
2281
Ok ( WeightToFee :: weight_to_fee( & weight) )
2279
2282
}
2280
2283
2281
- fn query_xcm_weight( message: VersionedXcm <RuntimeCall >) -> Result <Weight , XcmPaymentError > {
2284
+ fn query_xcm_weight( message: VersionedXcm <RuntimeCall >) -> Result <Weight , XcmPaymentApiError > {
2282
2285
let mut message = message
2283
2286
. try_into( )
2284
- . map_err( |_| XcmPaymentError :: VersionedConversionFailed ) ?;
2287
+ . map_err( |_| XcmPaymentApiError :: VersionedConversionFailed ) ?;
2285
2288
<xcm_config:: XcmConfig as xcm_executor:: Config >:: Weigher :: weight( & mut message)
2286
- . map_err( |_| XcmPaymentError :: WeightNotComputable )
2289
+ . map_err( |_| XcmPaymentApiError :: WeightNotComputable )
2287
2290
}
2288
2291
}
2289
2292
@@ -2578,7 +2581,7 @@ mod remote_tests {
2578
2581
#[ tokio:: test]
2579
2582
async fn run_migrations ( ) {
2580
2583
if var ( "RUN_MIGRATION_TESTS" ) . is_err ( ) {
2581
- return
2584
+ return ;
2582
2585
}
2583
2586
2584
2587
sp_tracing:: try_init_simple ( ) ;
0 commit comments