@@ -680,6 +680,8 @@ impl_opaque_keys! {
680
680
681
681
#[ cfg( feature = "staking-playground" ) ]
682
682
pub mod staking_playground {
683
+ use pallet_staking:: Exposure ;
684
+
683
685
use super :: * ;
684
686
685
687
/// An adapter to make the chain work with --dev only, even though it is running a large staking
@@ -714,43 +716,61 @@ pub mod staking_playground {
714
716
}
715
717
}
716
718
717
- impl pallet_session:: historical:: SessionManager < AccountId , ( ) > for AliceAsOnlyValidator {
719
+ impl pallet_session:: historical:: SessionManager < AccountId , Exposure < AccountId , Balance > >
720
+ for AliceAsOnlyValidator
721
+ {
718
722
fn end_session ( end_index : sp_staking:: SessionIndex ) {
719
- <Staking as pallet_session:: historical:: SessionManager < AccountId , ( ) > >:: end_session (
720
- end_index,
721
- )
723
+ <Staking as pallet_session:: historical:: SessionManager <
724
+ AccountId ,
725
+ Exposure < AccountId , Balance > ,
726
+ > >:: end_session ( end_index)
722
727
}
723
728
724
- fn new_session ( new_index : sp_staking:: SessionIndex ) -> Option < Vec < ( AccountId , ( ) ) > > {
725
- <Staking as pallet_session:: historical:: SessionManager < AccountId , ( ) > >:: new_session (
726
- new_index,
727
- )
729
+ fn new_session (
730
+ new_index : sp_staking:: SessionIndex ,
731
+ ) -> Option < Vec < ( AccountId , Exposure < AccountId , Balance > ) > > {
732
+ <Staking as pallet_session:: historical:: SessionManager <
733
+ AccountId ,
734
+ Exposure < AccountId , Balance > ,
735
+ > >:: new_session ( new_index)
728
736
. map ( |_ignored| {
729
737
// construct a fake exposure for alice.
730
- vec ! [ ( sp_keyring:: Sr25519Keyring :: AliceStash . to_account_id( ) . into( ) , ( ) ) ]
738
+ vec ! [ (
739
+ sp_keyring:: Sr25519Keyring :: AliceStash . to_account_id( ) . into( ) ,
740
+ pallet_staking:: Exposure {
741
+ total: 1_000_000_000 ,
742
+ own: 1_000_000_000 ,
743
+ others: vec![ ] ,
744
+ } ,
745
+ ) ]
731
746
} )
732
747
}
733
748
734
749
fn new_session_genesis (
735
750
new_index : sp_staking:: SessionIndex ,
736
- ) -> Option < Vec < ( AccountId , ( ) ) > > {
751
+ ) -> Option < Vec < ( AccountId , Exposure < AccountId , Balance > ) > > {
737
752
<Staking as pallet_session:: historical:: SessionManager <
738
753
AccountId ,
739
- ( ) ,
754
+ Exposure < AccountId , Balance > ,
740
755
> >:: new_session_genesis ( new_index)
741
756
. map ( |_ignored| {
742
757
// construct a fake exposure for alice.
743
758
vec ! [ (
744
759
sp_keyring:: Sr25519Keyring :: AliceStash . to_account_id( ) . into( ) ,
745
- ( ) ,
760
+ pallet_staking:: Exposure {
761
+ total: 1_000_000_000 ,
762
+ own: 1_000_000_000 ,
763
+ others: vec![ ] ,
764
+ } ,
746
765
) ]
747
766
} )
748
767
}
749
768
750
769
fn start_session ( start_index : sp_staking:: SessionIndex ) {
751
- <Staking as pallet_session:: historical:: SessionManager < AccountId , ( ) > >:: start_session (
752
- start_index,
753
- )
770
+ <Staking as pallet_session:: historical:: SessionManager <
771
+ AccountId ,
772
+ Exposure < AccountId , Balance > ,
773
+ > >:: start_session ( start_index)
754
774
}
755
775
}
756
776
}
@@ -776,8 +796,8 @@ impl pallet_session::Config for Runtime {
776
796
}
777
797
778
798
impl pallet_session:: historical:: Config for Runtime {
779
- type FullIdentification = ( ) ;
780
- type FullIdentificationOf = pallet_staking:: NullIdentity ;
799
+ type FullIdentification = pallet_staking :: Exposure < AccountId , Balance > ;
800
+ type FullIdentificationOf = pallet_staking:: ExposureOf < Runtime > ;
781
801
}
782
802
783
803
pallet_staking_reward_curve:: build! {
0 commit comments