@@ -47,8 +47,8 @@ use sp_staking::{
47
47
48
48
use crate :: {
49
49
asset, election_size_tracker:: StaticTracker , log, slashing, weights:: WeightInfo , ActiveEraInfo ,
50
- BalanceOf , BoundedExposuresOf , EraInfo , EraPayout , ExistenceOrLegacyExposure , Exposure ,
51
- Forcing , IndividualExposure , LedgerIntegrityState , MaxNominationsOf , MaxWinnersOf ,
50
+ BalanceOf , BoundedExposuresOf , EraInfo , EraPayout , Existence , ExistenceOrLegacyExposure ,
51
+ Exposure , Forcing , IndividualExposure , LedgerIntegrityState , MaxNominationsOf , MaxWinnersOf ,
52
52
MaxWinnersPerPageOf , Nominations , NominationsQuota , PositiveImbalanceOf , RewardDestination ,
53
53
SessionInterface , SnapshotStatus , StakingLedger , ValidatorPrefs , STAKING_ID ,
54
54
} ;
@@ -1728,42 +1728,23 @@ impl<T: Config> pallet_session::SessionManager<T::AccountId> for Pallet<T> {
1728
1728
}
1729
1729
}
1730
1730
1731
- impl < T : Config > historical:: SessionManager < T :: AccountId , Exposure < T :: AccountId , BalanceOf < T > > >
1731
+ impl < T : Config >
1732
+ historical:: SessionManager < T :: AccountId , ExistenceOrLegacyExposure < T :: AccountId , BalanceOf < T > > >
1732
1733
for Pallet < T >
1733
1734
{
1734
1735
fn new_session (
1735
1736
new_index : SessionIndex ,
1736
- ) -> Option < Vec < ( T :: AccountId , Exposure < T :: AccountId , BalanceOf < T > > ) > > {
1737
+ ) -> Option < Vec < ( T :: AccountId , ExistenceOrLegacyExposure < T :: AccountId , BalanceOf < T > > ) > > {
1737
1738
<Self as pallet_session:: SessionManager < _ > >:: new_session ( new_index) . map ( |validators| {
1738
- let current_era = CurrentEra :: < T > :: get ( )
1739
- // Must be some as a new era has been created.
1740
- . unwrap_or ( 0 ) ;
1741
-
1742
- validators
1743
- . into_iter ( )
1744
- . map ( |v| {
1745
- let exposure = Self :: eras_stakers ( current_era, & v) ;
1746
- ( v, exposure)
1747
- } )
1748
- . collect ( )
1739
+ validators. into_iter ( ) . map ( |v| ( v, ExistenceOrLegacyExposure :: Exists ) ) . collect ( )
1749
1740
} )
1750
1741
}
1751
1742
fn new_session_genesis (
1752
1743
new_index : SessionIndex ,
1753
- ) -> Option < Vec < ( T :: AccountId , Exposure < T :: AccountId , BalanceOf < T > > ) > > {
1744
+ ) -> Option < Vec < ( T :: AccountId , ExistenceOrLegacyExposure < T :: AccountId , BalanceOf < T > > ) > > {
1754
1745
<Self as pallet_session:: SessionManager < _ > >:: new_session_genesis ( new_index) . map (
1755
1746
|validators| {
1756
- let current_era = CurrentEra :: < T > :: get ( )
1757
- // Must be some as a new era has been created.
1758
- . unwrap_or ( 0 ) ;
1759
-
1760
- validators
1761
- . into_iter ( )
1762
- . map ( |v| {
1763
- let exposure = Self :: eras_stakers ( current_era, & v) ;
1764
- ( v, exposure)
1765
- } )
1766
- . collect ( )
1747
+ validators. into_iter ( ) . map ( |v| ( v, ExistenceOrLegacyExposure :: Exists ) ) . collect ( )
1767
1748
} ,
1768
1749
)
1769
1750
}
@@ -1775,25 +1756,14 @@ impl<T: Config> historical::SessionManager<T::AccountId, Exposure<T::AccountId,
1775
1756
}
1776
1757
}
1777
1758
1778
- impl < T : Config >
1779
- historical:: SessionManager < T :: AccountId , ExistenceOrLegacyExposure < T :: AccountId , BalanceOf < T > > >
1780
- for Pallet < T >
1781
- {
1782
- fn new_session (
1783
- new_index : SessionIndex ,
1784
- ) -> Option < Vec < ( T :: AccountId , ExistenceOrLegacyExposure < T :: AccountId , BalanceOf < T > > ) > > {
1785
- <Self as pallet_session:: SessionManager < _ > >:: new_session ( new_index) . map ( |validators| {
1786
- validators. into_iter ( ) . map ( |v| ( v, ExistenceOrLegacyExposure :: Exists ) ) . collect ( )
1787
- } )
1759
+ impl < T : Config > historical:: SessionManager < T :: AccountId , Existence > for Pallet < T > {
1760
+ fn new_session ( new_index : SessionIndex ) -> Option < Vec < ( T :: AccountId , Existence ) > > {
1761
+ <Self as pallet_session:: SessionManager < _ > >:: new_session ( new_index)
1762
+ . map ( |validators| validators. into_iter ( ) . map ( |v| ( v, ( ) ) ) . collect ( ) )
1788
1763
}
1789
- fn new_session_genesis (
1790
- new_index : SessionIndex ,
1791
- ) -> Option < Vec < ( T :: AccountId , ExistenceOrLegacyExposure < T :: AccountId , BalanceOf < T > > ) > > {
1792
- <Self as pallet_session:: SessionManager < _ > >:: new_session_genesis ( new_index) . map (
1793
- |validators| {
1794
- validators. into_iter ( ) . map ( |v| ( v, ExistenceOrLegacyExposure :: Exists ) ) . collect ( )
1795
- } ,
1796
- )
1764
+ fn new_session_genesis ( new_index : SessionIndex ) -> Option < Vec < ( T :: AccountId , Existence ) > > {
1765
+ <Self as pallet_session:: SessionManager < _ > >:: new_session_genesis ( new_index)
1766
+ . map ( |validators| validators. into_iter ( ) . map ( |v| ( v, ( ) ) ) . collect ( ) )
1797
1767
}
1798
1768
fn start_session ( start_index : SessionIndex ) {
1799
1769
<Self as pallet_session:: SessionManager < _ > >:: start_session ( start_index)
0 commit comments