SetFromParamStruct -> SetStruct
This commit is contained in:
parent
991ac424d2
commit
d6105c5855
|
@ -112,8 +112,15 @@ func (s Store) SetRaw(ctx sdk.Context, key string, param []byte) {
|
||||||
tstore.Set(keybz, []byte{})
|
tstore.Set(keybz, []byte{})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Get to ParamStruct
|
||||||
|
func (s Store) GetStruct(ctx sdk.Context, ps ParamStruct) {
|
||||||
|
for _, pair := range ps.KeyFieldPairs() {
|
||||||
|
s.Get(ctx, pair.Key, pair.Field)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Set from ParamStruct
|
// Set from ParamStruct
|
||||||
func (s Store) SetFromParamStruct(ctx sdk.Context, ps ParamStruct) {
|
func (s Store) SetStruct(ctx sdk.Context, ps ParamStruct) {
|
||||||
for _, pair := range ps.KeyFieldPairs() {
|
for _, pair := range ps.KeyFieldPairs() {
|
||||||
s.Set(ctx, pair.Key, pair.Field)
|
s.Set(ctx, pair.Key, pair.Field)
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,5 +24,5 @@ func InitGenesis(ctx sdk.Context, keeper Keeper, data GenesisState, sdata types.
|
||||||
keeper.addPubkey(ctx, validator.GetPubKey())
|
keeper.addPubkey(ctx, validator.GetPubKey())
|
||||||
}
|
}
|
||||||
|
|
||||||
keeper.paramstore.SetFromParamStruct(ctx, &data.Params)
|
keeper.paramstore.SetStruct(ctx, &data.Params)
|
||||||
}
|
}
|
||||||
|
|
|
@ -79,11 +79,5 @@ func (k Keeper) SetParams(ctx sdk.Context, params types.Params) {
|
||||||
|
|
||||||
// set the params without updating validator set
|
// set the params without updating validator set
|
||||||
func (k Keeper) SetNewParams(ctx sdk.Context, params types.Params) {
|
func (k Keeper) SetNewParams(ctx sdk.Context, params types.Params) {
|
||||||
k.paramstore.Set(ctx, types.KeyInflationRateChange, params.InflationRateChange)
|
k.paramstore.SetStruct(ctx, ¶ms)
|
||||||
k.paramstore.Set(ctx, types.KeyInflationMax, params.InflationMax)
|
|
||||||
k.paramstore.Set(ctx, types.KeyInflationMin, params.InflationMin)
|
|
||||||
k.paramstore.Set(ctx, types.KeyGoalBonded, params.GoalBonded)
|
|
||||||
k.paramstore.Set(ctx, types.KeyUnbondingTime, params.UnbondingTime)
|
|
||||||
k.paramstore.Set(ctx, types.KeyMaxValidators, params.MaxValidators)
|
|
||||||
k.paramstore.Set(ctx, types.KeyBondDenom, params.BondDenom)
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue