finalize rebase

This commit is contained in:
mossid 2018-10-07 01:16:11 +09:00
parent 4bf14c5650
commit 9fc7e80d48
1 changed files with 1 additions and 12 deletions

View File

@ -72,18 +72,7 @@ func (k Keeper) GetParams(ctx sdk.Context) (res types.Params) {
return return
} }
// Need a distinct function because setParams depends on an existing previous // set the params
// record of params to exist (to check if maxValidators has changed) - and we
// panic on retrieval if it doesn't exist - hence if we use setParams for the very
// first params set it will panic.
func (k Keeper) SetParams(ctx sdk.Context, params types.Params) { func (k Keeper) SetParams(ctx sdk.Context, params types.Params) {
if k.MaxValidators(ctx) != params.MaxValidators {
k.UpdateBondedValidatorsFull(ctx)
}
k.SetNewParams(ctx, params)
}
// set the params without updating validator set
func (k Keeper) SetNewParams(ctx sdk.Context, params types.Params) {
k.paramstore.SetStruct(ctx, &params) k.paramstore.SetStruct(ctx, &params)
} }