Skip to content

Commit

Permalink
split param getter and unmarshal (#502)
Browse files Browse the repository at this point in the history
  • Loading branch information
czarcas7ic authored Jan 8, 2024
1 parent 7ff0763 commit 65d7acf
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions x/consensus/keeper/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,17 @@ func (k *Keeper) Set(ctx sdk.Context, cp *tmproto.ConsensusParams) {
store := ctx.KVStore(k.storeKey)
store.Set(types.ParamStoreKeyConsensusParams, k.cdc.MustMarshal(cp))
}

func (k *Keeper) GetParamsNoUnmarshal(ctx sdk.Context) []byte {
store := ctx.KVStore(k.storeKey)
return store.Get(types.ParamStoreKeyConsensusParams)
}

func (k *Keeper) UnmarshalParamBytes(ctx sdk.Context, bz []byte) (*tmproto.ConsensusParams, error) {
cp := &tmproto.ConsensusParams{}
if err := k.cdc.Unmarshal(bz, cp); err != nil {
return nil, err
}

return cp, nil
}

0 comments on commit 65d7acf

Please sign in to comment.