@@ -107,7 +107,7 @@ use xcm::{
107
107
use xcm_builder:: PayOverXcm ;
108
108
109
109
use xcm_executor:: traits:: WeightBounds ;
110
- use xcm_payment_runtime_api:: Error as XcmPaymentError ;
110
+ use xcm_payment_runtime_api:: Error as XcmPaymentApiError ;
111
111
112
112
pub use frame_system:: Call as SystemCall ;
113
113
pub use pallet_balances:: Call as BalancesCall ;
@@ -442,10 +442,12 @@ impl OpaqueKeys for OldSessionKeys {
442
442
<<Babe as BoundToRuntimeAppPublic >:: Public >:: ID => self . babe . as_ref ( ) ,
443
443
sp_core:: crypto:: key_types:: IM_ONLINE => self . im_online . as_ref ( ) ,
444
444
<<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
+ } ,
449
451
<<Beefy as BoundToRuntimeAppPublic >:: Public >:: ID => self . beefy . as_ref ( ) ,
450
452
_ => & [ ] ,
451
453
}
@@ -1052,11 +1054,12 @@ impl InstanceFilter<RuntimeCall> for ProxyType {
1052
1054
ProxyType :: Staking => {
1053
1055
matches ! (
1054
1056
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 ( ..)
1060
1063
)
1061
1064
} ,
1062
1065
ProxyType :: NominationPools => {
@@ -1072,24 +1075,24 @@ impl InstanceFilter<RuntimeCall> for ProxyType {
1072
1075
ProxyType :: Governance => matches ! (
1073
1076
c,
1074
1077
// OpenGov calls
1075
- RuntimeCall :: ConvictionVoting ( ..) |
1076
- RuntimeCall :: Referenda ( ..) |
1077
- RuntimeCall :: Whitelist ( ..)
1078
+ RuntimeCall :: ConvictionVoting ( ..)
1079
+ | RuntimeCall :: Referenda ( ..)
1080
+ | RuntimeCall :: Whitelist ( ..)
1078
1081
) ,
1079
1082
ProxyType :: IdentityJudgement => matches ! (
1080
1083
c,
1081
- RuntimeCall :: Identity ( pallet_identity:: Call :: provide_judgement { .. } ) |
1082
- RuntimeCall :: Utility ( ..)
1084
+ RuntimeCall :: Identity ( pallet_identity:: Call :: provide_judgement { .. } )
1085
+ | RuntimeCall :: Utility ( ..)
1083
1086
) ,
1084
1087
ProxyType :: CancelProxy => {
1085
1088
matches ! ( c, RuntimeCall :: Proxy ( pallet_proxy:: Call :: reject_announcement { .. } ) )
1086
1089
} ,
1087
1090
ProxyType :: Auction => matches ! (
1088
1091
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 ( ..)
1093
1096
) ,
1094
1097
}
1095
1098
}
@@ -1592,11 +1595,11 @@ pub mod migrations {
1592
1595
let now = frame_system:: Pallet :: < Runtime > :: block_number ( ) ;
1593
1596
let lease = slots:: Pallet :: < Runtime > :: lease ( para) ;
1594
1597
if lease. is_empty ( ) {
1595
- return None
1598
+ return None ;
1596
1599
}
1597
1600
// Lease not yet started, ignore:
1598
1601
if lease. iter ( ) . any ( Option :: is_none) {
1599
- return None
1602
+ return None ;
1600
1603
}
1601
1604
let ( index, _) =
1602
1605
<slots:: Pallet < Runtime > as Leaser < BlockNumber > >:: lease_period_index ( now) ?;
@@ -1618,7 +1621,7 @@ pub mod migrations {
1618
1621
fn pre_upgrade ( ) -> Result < sp_std:: vec:: Vec < u8 > , sp_runtime:: TryRuntimeError > {
1619
1622
if System :: last_runtime_upgrade_spec_version ( ) > UPGRADE_SESSION_KEYS_FROM_SPEC {
1620
1623
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 ( ) ) ;
1622
1625
}
1623
1626
1624
1627
log:: info!( target: "runtime::session_keys" , "Collecting pre-upgrade session keys state" ) ;
@@ -1647,7 +1650,7 @@ pub mod migrations {
1647
1650
fn on_runtime_upgrade ( ) -> Weight {
1648
1651
if System :: last_runtime_upgrade_spec_version ( ) > UPGRADE_SESSION_KEYS_FROM_SPEC {
1649
1652
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 ) ;
1651
1654
}
1652
1655
log:: info!( "Upgrading session keys" ) ;
1653
1656
Session :: upgrade_keys :: < OldSessionKeys , _ > ( transform_session_keys) ;
@@ -1660,7 +1663,7 @@ pub mod migrations {
1660
1663
) -> Result < ( ) , sp_runtime:: TryRuntimeError > {
1661
1664
if System :: last_runtime_upgrade_spec_version ( ) > UPGRADE_SESSION_KEYS_FROM_SPEC {
1662
1665
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 ( ( ) ) ;
1664
1667
}
1665
1668
1666
1669
let key_ids = SessionKeys :: key_ids ( ) ;
@@ -2259,33 +2262,33 @@ sp_api::impl_runtime_apis! {
2259
2262
}
2260
2263
2261
2264
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 > {
2263
2266
if !matches!( xcm_version, 3 | 4 ) {
2264
- return Err ( XcmPaymentError :: UnhandledXcmVersion ) ;
2267
+ return Err ( XcmPaymentApiError :: UnhandledXcmVersion ) ;
2265
2268
}
2266
2269
Ok ( [ VersionedAssetId :: V4 ( xcm_config:: TokenLocation :: get( ) . into( ) ) ]
2267
2270
. into_iter( )
2268
2271
. filter_map( |asset| asset. into_version( xcm_version) . ok( ) )
2269
2272
. collect( ) )
2270
2273
}
2271
2274
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 > {
2273
2276
let local_asset = VersionedAssetId :: V4 ( xcm_config:: TokenLocation :: get( ) . into( ) ) ;
2274
2277
let asset = asset
2275
2278
. into_version( 4 )
2276
- . map_err( |_| XcmPaymentError :: VersionedConversionFailed ) ?;
2279
+ . map_err( |_| XcmPaymentApiError :: VersionedConversionFailed ) ?;
2277
2280
2278
- if asset != local_asset { return Err ( XcmPaymentError :: AssetNotFound ) ; }
2281
+ if asset != local_asset { return Err ( XcmPaymentApiError :: AssetNotFound ) ; }
2279
2282
2280
2283
Ok ( WeightToFee :: weight_to_fee( & weight) )
2281
2284
}
2282
2285
2283
- fn query_xcm_weight( message: VersionedXcm <RuntimeCall >) -> Result <Weight , XcmPaymentError > {
2286
+ fn query_xcm_weight( message: VersionedXcm <RuntimeCall >) -> Result <Weight , XcmPaymentApiError > {
2284
2287
let mut message = message
2285
2288
. try_into( )
2286
- . map_err( |_| XcmPaymentError :: VersionedConversionFailed ) ?;
2289
+ . map_err( |_| XcmPaymentApiError :: VersionedConversionFailed ) ?;
2287
2290
<xcm_config:: XcmConfig as xcm_executor:: Config >:: Weigher :: weight( & mut message)
2288
- . map_err( |_| XcmPaymentError :: WeightNotComputable )
2291
+ . map_err( |_| XcmPaymentApiError :: WeightNotComputable )
2289
2292
}
2290
2293
}
2291
2294
@@ -2609,7 +2612,7 @@ mod remote_tests {
2609
2612
#[ tokio:: test]
2610
2613
async fn run_migrations ( ) {
2611
2614
if var ( "RUN_MIGRATION_TESTS" ) . is_err ( ) {
2612
- return
2615
+ return ;
2613
2616
}
2614
2617
2615
2618
sp_tracing:: try_init_simple ( ) ;
0 commit comments