@@ -107,7 +107,7 @@ use xcm::{
107107use xcm_builder:: PayOverXcm ;
108108
109109use xcm_executor:: traits:: WeightBounds ;
110- use xcm_payment_runtime_api:: Error as XcmPaymentError ;
110+ use xcm_payment_runtime_api:: Error as XcmPaymentApiError ;
111111
112112pub use frame_system:: Call as SystemCall ;
113113pub use pallet_balances:: Call as BalancesCall ;
@@ -442,10 +442,12 @@ impl OpaqueKeys for OldSessionKeys {
442442 <<Babe as BoundToRuntimeAppPublic >:: Public >:: ID => self . babe . as_ref ( ) ,
443443 sp_core:: crypto:: key_types:: IM_ONLINE => self . im_online . as_ref ( ) ,
444444 <<Initializer as BoundToRuntimeAppPublic >:: Public >:: ID => self . para_validator . as_ref ( ) ,
445- <<ParaSessionInfo as BoundToRuntimeAppPublic >:: Public >:: ID =>
446- self . para_assignment . as_ref ( ) ,
447- <<AuthorityDiscovery as BoundToRuntimeAppPublic >:: Public >:: ID =>
448- self . authority_discovery . as_ref ( ) ,
445+ <<ParaSessionInfo as BoundToRuntimeAppPublic >:: Public >:: ID => {
446+ self . para_assignment . as_ref ( )
447+ } ,
448+ <<AuthorityDiscovery as BoundToRuntimeAppPublic >:: Public >:: ID => {
449+ self . authority_discovery . as_ref ( )
450+ } ,
449451 <<Beefy as BoundToRuntimeAppPublic >:: Public >:: ID => self . beefy . as_ref ( ) ,
450452 _ => & [ ] ,
451453 }
@@ -1052,11 +1054,12 @@ impl InstanceFilter<RuntimeCall> for ProxyType {
10521054 ProxyType :: Staking => {
10531055 matches ! (
10541056 c,
1055- RuntimeCall :: Staking ( ..) |
1056- RuntimeCall :: Session ( ..) | RuntimeCall :: Utility ( ..) |
1057- RuntimeCall :: FastUnstake ( ..) |
1058- RuntimeCall :: VoterList ( ..) |
1059- RuntimeCall :: NominationPools ( ..)
1057+ RuntimeCall :: Staking ( ..)
1058+ | RuntimeCall :: Session ( ..)
1059+ | RuntimeCall :: Utility ( ..)
1060+ | RuntimeCall :: FastUnstake ( ..)
1061+ | RuntimeCall :: VoterList ( ..)
1062+ | RuntimeCall :: NominationPools ( ..)
10601063 )
10611064 } ,
10621065 ProxyType :: NominationPools => {
@@ -1072,24 +1075,24 @@ impl InstanceFilter<RuntimeCall> for ProxyType {
10721075 ProxyType :: Governance => matches ! (
10731076 c,
10741077 // OpenGov calls
1075- RuntimeCall :: ConvictionVoting ( ..) |
1076- RuntimeCall :: Referenda ( ..) |
1077- RuntimeCall :: Whitelist ( ..)
1078+ RuntimeCall :: ConvictionVoting ( ..)
1079+ | RuntimeCall :: Referenda ( ..)
1080+ | RuntimeCall :: Whitelist ( ..)
10781081 ) ,
10791082 ProxyType :: IdentityJudgement => matches ! (
10801083 c,
1081- RuntimeCall :: Identity ( pallet_identity:: Call :: provide_judgement { .. } ) |
1082- RuntimeCall :: Utility ( ..)
1084+ RuntimeCall :: Identity ( pallet_identity:: Call :: provide_judgement { .. } )
1085+ | RuntimeCall :: Utility ( ..)
10831086 ) ,
10841087 ProxyType :: CancelProxy => {
10851088 matches ! ( c, RuntimeCall :: Proxy ( pallet_proxy:: Call :: reject_announcement { .. } ) )
10861089 } ,
10871090 ProxyType :: Auction => matches ! (
10881091 c,
1089- RuntimeCall :: Auctions ( ..) |
1090- RuntimeCall :: Crowdloan ( ..) |
1091- RuntimeCall :: Registrar ( ..) |
1092- RuntimeCall :: Slots ( ..)
1092+ RuntimeCall :: Auctions ( ..)
1093+ | RuntimeCall :: Crowdloan ( ..)
1094+ | RuntimeCall :: Registrar ( ..)
1095+ | RuntimeCall :: Slots ( ..)
10931096 ) ,
10941097 }
10951098 }
@@ -1592,11 +1595,11 @@ pub mod migrations {
15921595 let now = frame_system:: Pallet :: < Runtime > :: block_number ( ) ;
15931596 let lease = slots:: Pallet :: < Runtime > :: lease ( para) ;
15941597 if lease. is_empty ( ) {
1595- return None
1598+ return None ;
15961599 }
15971600 // Lease not yet started, ignore:
15981601 if lease. iter ( ) . any ( Option :: is_none) {
1599- return None
1602+ return None ;
16001603 }
16011604 let ( index, _) =
16021605 <slots:: Pallet < Runtime > as Leaser < BlockNumber > >:: lease_period_index ( now) ?;
@@ -1618,7 +1621,7 @@ pub mod migrations {
16181621 fn pre_upgrade ( ) -> Result < sp_std:: vec:: Vec < u8 > , sp_runtime:: TryRuntimeError > {
16191622 if System :: last_runtime_upgrade_spec_version ( ) > UPGRADE_SESSION_KEYS_FROM_SPEC {
16201623 log:: warn!( target: "runtime::session_keys" , "Skipping session keys migration pre-upgrade check due to spec version (already applied?)" ) ;
1621- return Ok ( Vec :: new ( ) )
1624+ return Ok ( Vec :: new ( ) ) ;
16221625 }
16231626
16241627 log:: info!( target: "runtime::session_keys" , "Collecting pre-upgrade session keys state" ) ;
@@ -1647,7 +1650,7 @@ pub mod migrations {
16471650 fn on_runtime_upgrade ( ) -> Weight {
16481651 if System :: last_runtime_upgrade_spec_version ( ) > UPGRADE_SESSION_KEYS_FROM_SPEC {
16491652 log:: warn!( "Skipping session keys upgrade: already applied" ) ;
1650- return <Runtime as frame_system:: Config >:: DbWeight :: get ( ) . reads ( 1 )
1653+ return <Runtime as frame_system:: Config >:: DbWeight :: get ( ) . reads ( 1 ) ;
16511654 }
16521655 log:: info!( "Upgrading session keys" ) ;
16531656 Session :: upgrade_keys :: < OldSessionKeys , _ > ( transform_session_keys) ;
@@ -1660,7 +1663,7 @@ pub mod migrations {
16601663 ) -> Result < ( ) , sp_runtime:: TryRuntimeError > {
16611664 if System :: last_runtime_upgrade_spec_version ( ) > UPGRADE_SESSION_KEYS_FROM_SPEC {
16621665 log:: warn!( target: "runtime::session_keys" , "Skipping session keys migration post-upgrade check due to spec version (already applied?)" ) ;
1663- return Ok ( ( ) )
1666+ return Ok ( ( ) ) ;
16641667 }
16651668
16661669 let key_ids = SessionKeys :: key_ids ( ) ;
@@ -2259,33 +2262,33 @@ sp_api::impl_runtime_apis! {
22592262 }
22602263
22612264 impl xcm_payment_runtime_api:: XcmPaymentApi <Block , RuntimeCall > for Runtime {
2262- fn query_acceptable_payment_assets( xcm_version: xcm:: Version ) -> Result <Vec <VersionedAssetId >, XcmPaymentError > {
2265+ fn query_acceptable_payment_assets( xcm_version: xcm:: Version ) -> Result <Vec <VersionedAssetId >, XcmPaymentApiError > {
22632266 if !matches!( xcm_version, 3 | 4 ) {
2264- return Err ( XcmPaymentError :: UnhandledXcmVersion ) ;
2267+ return Err ( XcmPaymentApiError :: UnhandledXcmVersion ) ;
22652268 }
22662269 Ok ( [ VersionedAssetId :: V4 ( xcm_config:: TokenLocation :: get( ) . into( ) ) ]
22672270 . into_iter( )
22682271 . filter_map( |asset| asset. into_version( xcm_version) . ok( ) )
22692272 . collect( ) )
22702273 }
22712274
2272- fn query_weight_to_asset_fee( weight: Weight , asset: VersionedAssetId ) -> Result <u128 , XcmPaymentError > {
2275+ fn query_weight_to_asset_fee( weight: Weight , asset: VersionedAssetId ) -> Result <u128 , XcmPaymentApiError > {
22732276 let local_asset = VersionedAssetId :: V4 ( xcm_config:: TokenLocation :: get( ) . into( ) ) ;
22742277 let asset = asset
22752278 . into_version( 4 )
2276- . map_err( |_| XcmPaymentError :: VersionedConversionFailed ) ?;
2279+ . map_err( |_| XcmPaymentApiError :: VersionedConversionFailed ) ?;
22772280
2278- if asset != local_asset { return Err ( XcmPaymentError :: AssetNotFound ) ; }
2281+ if asset != local_asset { return Err ( XcmPaymentApiError :: AssetNotFound ) ; }
22792282
22802283 Ok ( WeightToFee :: weight_to_fee( & weight) )
22812284 }
22822285
2283- fn query_xcm_weight( message: VersionedXcm <RuntimeCall >) -> Result <Weight , XcmPaymentError > {
2286+ fn query_xcm_weight( message: VersionedXcm <RuntimeCall >) -> Result <Weight , XcmPaymentApiError > {
22842287 let mut message = message
22852288 . try_into( )
2286- . map_err( |_| XcmPaymentError :: VersionedConversionFailed ) ?;
2289+ . map_err( |_| XcmPaymentApiError :: VersionedConversionFailed ) ?;
22872290 <xcm_config:: XcmConfig as xcm_executor:: Config >:: Weigher :: weight( & mut message)
2288- . map_err( |_| XcmPaymentError :: WeightNotComputable )
2291+ . map_err( |_| XcmPaymentApiError :: WeightNotComputable )
22892292 }
22902293 }
22912294
@@ -2609,7 +2612,7 @@ mod remote_tests {
26092612 #[ tokio:: test]
26102613 async fn run_migrations ( ) {
26112614 if var ( "RUN_MIGRATION_TESTS" ) . is_err ( ) {
2612- return
2615+ return ;
26132616 }
26142617
26152618 sp_tracing:: try_init_simple ( ) ;
0 commit comments