30
30
use cumulus_primitives_core:: {
31
31
relay_chain, AbridgedHostConfiguration , ChannelStatus , CollationInfo , DmpMessageHandler ,
32
32
GetChannelInfo , InboundDownwardMessage , InboundHrmpMessage , MessageSendError , OnValidationData ,
33
- OutboundHrmpMessage , ParaId , UpwardMessage , UpwardMessageSender , XcmpMessageHandler ,
34
- XcmpMessageSource , PersistedValidationData ,
33
+ OutboundHrmpMessage , ParaId , PersistedValidationData , UpwardMessage , UpwardMessageSender ,
34
+ XcmpMessageHandler , XcmpMessageSource ,
35
35
} ;
36
36
use cumulus_primitives_parachain_inherent:: ParachainInherentData ;
37
37
use frame_support:: {
@@ -46,7 +46,7 @@ use frame_system::{ensure_none, ensure_root};
46
46
use polkadot_parachain:: primitives:: RelayChainBlockNumber ;
47
47
use relay_state_snapshot:: MessagingStateSnapshot ;
48
48
use sp_runtime:: {
49
- traits:: { BlakeTwo256 , Block as BlockT , Hash , BlockNumberProvider } ,
49
+ traits:: { BlakeTwo256 , Block as BlockT , BlockNumberProvider , Hash } ,
50
50
transaction_validity:: {
51
51
InvalidTransaction , TransactionLongevity , TransactionSource , TransactionValidity ,
52
52
ValidTransaction ,
@@ -393,7 +393,10 @@ pub mod pallet {
393
393
}
394
394
395
395
#[ pallet:: weight( 1_000_000 ) ]
396
- pub fn enact_authorized_upgrade ( _: OriginFor < T > , code : Vec < u8 > ) -> DispatchResultWithPostInfo {
396
+ pub fn enact_authorized_upgrade (
397
+ _: OriginFor < T > ,
398
+ code : Vec < u8 > ,
399
+ ) -> DispatchResultWithPostInfo {
397
400
Self :: validate_authorized_upgrade ( & code[ ..] ) ?;
398
401
Self :: set_code_impl ( code) ?;
399
402
AuthorizedUpgrade :: < T > :: kill ( ) ;
@@ -403,7 +406,6 @@ pub mod pallet {
403
406
404
407
#[ pallet:: event]
405
408
#[ pallet:: generate_deposit( pub ( super ) fn deposit_event) ]
406
- #[ pallet:: metadata( T :: Hash = "Hash" ) ]
407
409
pub enum Event < T : Config > {
408
410
/// The validation function has been scheduled to apply as of the contained relay chain
409
411
/// block number.
@@ -576,11 +578,11 @@ pub mod pallet {
576
578
. flatten ( )
577
579
. expect ( "validation function params are always injected into inherent data; qed" ) ;
578
580
579
- Some ( Call :: set_validation_data ( data) )
581
+ Some ( Call :: set_validation_data { data } )
580
582
}
581
583
582
584
fn is_inherent ( call : & Self :: Call ) -> bool {
583
- matches ! ( call, Call :: set_validation_data( _ ) )
585
+ matches ! ( call, Call :: set_validation_data { .. } )
584
586
}
585
587
}
586
588
@@ -599,9 +601,9 @@ pub mod pallet {
599
601
#[ pallet:: validate_unsigned]
600
602
impl < T : Config > sp_runtime:: traits:: ValidateUnsigned for Pallet < T > {
601
603
type Call = Call < T > ;
602
-
604
+
603
605
fn validate_unsigned ( _source : TransactionSource , call : & Self :: Call ) -> TransactionValidity {
604
- if let Call :: enact_authorized_upgrade( ref code) = call {
606
+ if let Call :: enact_authorized_upgrade { ref code } = call {
605
607
if let Ok ( hash) = Self :: validate_authorized_upgrade ( code) {
606
608
return Ok ( ValidTransaction {
607
609
priority : 100 ,
@@ -612,7 +614,7 @@ pub mod pallet {
612
614
} ) ;
613
615
}
614
616
}
615
- if let Call :: set_validation_data( .. ) = call {
617
+ if let Call :: set_validation_data { .. } = call {
616
618
return Ok ( Default :: default ( ) ) ;
617
619
}
618
620
Err ( InvalidTransaction :: Call . into ( ) )
@@ -942,7 +944,7 @@ impl<T: Config> Pallet<T> {
942
944
943
945
pub struct ParachainSetCode < T > ( sp_std:: marker:: PhantomData < T > ) ;
944
946
945
- impl < T : Config > frame_system:: SetCode for ParachainSetCode < T > {
947
+ impl < T : Config > frame_system:: SetCode < T > for ParachainSetCode < T > {
946
948
fn set_code ( code : Vec < u8 > ) -> DispatchResult {
947
949
Pallet :: < T > :: set_code_impl ( code)
948
950
}
@@ -956,7 +958,7 @@ impl<T: Config> frame_system::SetCode for ParachainSetCode<T> {
956
958
/// A head for an empty chain is agreed to be a zero hash.
957
959
///
958
960
/// [hash chain]: https://en.wikipedia.org/wiki/Hash_chain
959
- #[ derive( Default , Clone , codec:: Encode , codec:: Decode ) ]
961
+ #[ derive( Default , Clone , codec:: Encode , codec:: Decode , scale_info :: TypeInfo ) ]
960
962
struct MessageQueueChain ( relay_chain:: Hash ) ;
961
963
962
964
impl MessageQueueChain {
0 commit comments