@@ -37,7 +37,7 @@ func (app *BitsongApp) ExportAppStateAndValidators(
3737 return servertypes.ExportedApp {}, err
3838 }
3939
40- validators , err := staking .WriteValidators (ctx , app .AppKeepers . StakingKeeper )
40+ validators , err := staking .WriteValidators (ctx , app .StakingKeeper )
4141 if err != nil {
4242 return servertypes.ExportedApp {}, err
4343 }
@@ -72,21 +72,21 @@ func (app *BitsongApp) prepForZeroHeightGenesis(ctx sdk.Context, jailAllowedAddr
7272 }
7373
7474 /* Just to be safe, assert the invariants on current state. */
75- app .AppKeepers . CrisisKeeper .AssertInvariants (ctx )
75+ app .CrisisKeeper .AssertInvariants (ctx )
7676
7777 /* Handle fee distribution state. */
7878
7979 // withdraw all validator commission
80- app .AppKeepers . StakingKeeper .IterateValidators (ctx , func (_ int64 , val stakingtypes.ValidatorI ) (stop bool ) {
81- _ , err := app .AppKeepers . DistrKeeper .WithdrawValidatorCommission (ctx , sdk .ValAddress (val .GetOperator ()))
80+ app .StakingKeeper .IterateValidators (ctx , func (_ int64 , val stakingtypes.ValidatorI ) (stop bool ) {
81+ _ , err := app .DistrKeeper .WithdrawValidatorCommission (ctx , sdk .ValAddress (val .GetOperator ()))
8282 if err != nil {
8383 panic (err )
8484 }
8585 return false
8686 })
8787
8888 // withdraw all delegator rewards
89- dels , err := app .AppKeepers . StakingKeeper .GetAllDelegations (ctx )
89+ dels , err := app .StakingKeeper .GetAllDelegations (ctx )
9090 if err != nil {
9191 panic (err )
9292 }
@@ -100,34 +100,34 @@ func (app *BitsongApp) prepForZeroHeightGenesis(ctx sdk.Context, jailAllowedAddr
100100 if err != nil {
101101 panic (err )
102102 }
103- _ , _ = app .AppKeepers . DistrKeeper .WithdrawDelegationRewards (ctx , delAddr , valAddr )
103+ _ , _ = app .DistrKeeper .WithdrawDelegationRewards (ctx , delAddr , valAddr )
104104 }
105105
106106 // clear validator slash events
107- app .AppKeepers . DistrKeeper .DeleteAllValidatorSlashEvents (ctx )
107+ app .DistrKeeper .DeleteAllValidatorSlashEvents (ctx )
108108
109109 // clear validator historical rewards
110- app .AppKeepers . DistrKeeper .DeleteAllValidatorHistoricalRewards (ctx )
110+ app .DistrKeeper .DeleteAllValidatorHistoricalRewards (ctx )
111111
112112 // set context height to zero
113113 height := ctx .BlockHeight ()
114114 ctx = ctx .WithBlockHeight (0 )
115115
116116 // reinitialize all validators
117- app .AppKeepers . StakingKeeper .IterateValidators (ctx , func (_ int64 , val stakingtypes.ValidatorI ) (stop bool ) {
117+ app .StakingKeeper .IterateValidators (ctx , func (_ int64 , val stakingtypes.ValidatorI ) (stop bool ) {
118118 // donate any unwithdrawn outstanding reward fraction tokens to the community pool
119- scraps , err := app .AppKeepers . DistrKeeper .GetValidatorOutstandingRewardsCoins (ctx , sdk .ValAddress (val .GetOperator ()))
119+ scraps , err := app .DistrKeeper .GetValidatorOutstandingRewardsCoins (ctx , sdk .ValAddress (val .GetOperator ()))
120120 if err != nil {
121121 panic (err )
122122 }
123- feePool , err := app .AppKeepers . DistrKeeper .FeePool .Get (ctx )
123+ feePool , err := app .DistrKeeper .FeePool .Get (ctx )
124124 if err != nil {
125125 panic (err )
126126 }
127127 feePool .CommunityPool = feePool .CommunityPool .Add (scraps ... )
128- app .AppKeepers . DistrKeeper .FeePool .Set (ctx , feePool )
128+ app .DistrKeeper .FeePool .Set (ctx , feePool )
129129
130- app .AppKeepers . DistrKeeper .Hooks ().AfterValidatorCreated (ctx , sdk .ValAddress (val .GetOperator ()))
130+ app .DistrKeeper .Hooks ().AfterValidatorCreated (ctx , sdk .ValAddress (val .GetOperator ()))
131131 return false
132132 })
133133
@@ -141,8 +141,8 @@ func (app *BitsongApp) prepForZeroHeightGenesis(ctx sdk.Context, jailAllowedAddr
141141 if err != nil {
142142 panic (err )
143143 }
144- app .AppKeepers . DistrKeeper .Hooks ().BeforeDelegationCreated (ctx , delAddr , valAddr )
145- app .AppKeepers . DistrKeeper .Hooks ().AfterDelegationModified (ctx , delAddr , valAddr )
144+ app .DistrKeeper .Hooks ().BeforeDelegationCreated (ctx , delAddr , valAddr )
145+ app .DistrKeeper .Hooks ().AfterDelegationModified (ctx , delAddr , valAddr )
146146 }
147147
148148 // reset context height
@@ -151,20 +151,20 @@ func (app *BitsongApp) prepForZeroHeightGenesis(ctx sdk.Context, jailAllowedAddr
151151 /* Handle staking state. */
152152
153153 // iterate through redelegations, reset creation height
154- app .AppKeepers . StakingKeeper .IterateRedelegations (ctx , func (_ int64 , red stakingtypes.Redelegation ) (stop bool ) {
154+ app .StakingKeeper .IterateRedelegations (ctx , func (_ int64 , red stakingtypes.Redelegation ) (stop bool ) {
155155 for i := range red .Entries {
156156 red .Entries [i ].CreationHeight = 0
157157 }
158- app .AppKeepers . StakingKeeper .SetRedelegation (ctx , red )
158+ app .StakingKeeper .SetRedelegation (ctx , red )
159159 return false
160160 })
161161
162162 // iterate through unbonding delegations, reset creation height
163- app .AppKeepers . StakingKeeper .IterateUnbondingDelegations (ctx , func (_ int64 , ubd stakingtypes.UnbondingDelegation ) (stop bool ) {
163+ app .StakingKeeper .IterateUnbondingDelegations (ctx , func (_ int64 , ubd stakingtypes.UnbondingDelegation ) (stop bool ) {
164164 for i := range ubd .Entries {
165165 ubd .Entries [i ].CreationHeight = 0
166166 }
167- app .AppKeepers . StakingKeeper .SetUnbondingDelegation (ctx , ubd )
167+ app .StakingKeeper .SetUnbondingDelegation (ctx , ubd )
168168 return false
169169 })
170170
@@ -176,7 +176,7 @@ func (app *BitsongApp) prepForZeroHeightGenesis(ctx sdk.Context, jailAllowedAddr
176176
177177 for ; iter .Valid (); iter .Next () {
178178 addr := sdk .ValAddress (iter .Key ()[1 :])
179- validator , err := app .AppKeepers . StakingKeeper .GetValidator (ctx , addr )
179+ validator , err := app .StakingKeeper .GetValidator (ctx , addr )
180180 if err != nil {
181181 panic ("expected validator, not found" )
182182 }
@@ -186,24 +186,24 @@ func (app *BitsongApp) prepForZeroHeightGenesis(ctx sdk.Context, jailAllowedAddr
186186 validator .Jailed = true
187187 }
188188
189- app .AppKeepers . StakingKeeper .SetValidator (ctx , validator )
189+ app .StakingKeeper .SetValidator (ctx , validator )
190190 counter ++
191191 }
192192
193193 iter .Close ()
194194
195- if _ , err := app .AppKeepers . StakingKeeper .ApplyAndReturnValidatorSetUpdates (ctx ); err != nil {
195+ if _ , err := app .StakingKeeper .ApplyAndReturnValidatorSetUpdates (ctx ); err != nil {
196196 panic (err )
197197 }
198198
199199 /* Handle slashing state. */
200200
201201 // reset start height on signing infos
202- app .AppKeepers . SlashingKeeper .IterateValidatorSigningInfos (
202+ app .SlashingKeeper .IterateValidatorSigningInfos (
203203 ctx ,
204204 func (addr sdk.ConsAddress , info slashingtypes.ValidatorSigningInfo ) (stop bool ) {
205205 info .StartHeight = 0
206- app .AppKeepers . SlashingKeeper .SetValidatorSigningInfo (ctx , addr , info )
206+ app .SlashingKeeper .SetValidatorSigningInfo (ctx , addr , info )
207207 return false
208208 },
209209 )
0 commit comments