-
Notifications
You must be signed in to change notification settings - Fork 162
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
decouple params into separate file (#2490)
- Loading branch information
Showing
3 changed files
with
21 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package keeper | ||
|
||
import ( | ||
sdk "github.com/cosmos/cosmos-sdk/types" | ||
"github.com/umee-network/umee/v6/util/store" | ||
"github.com/umee-network/umee/v6/x/leverage/types" | ||
) | ||
|
||
// SetParams sets the x/leverage module's parameters. | ||
func (k Keeper) SetParams(ctx sdk.Context, params types.Params) error { | ||
return store.SetValue(ctx.KVStore(k.storeKey), types.KeyParams, ¶ms, "leverage params") | ||
} | ||
|
||
// GetParams gets the x/leverage module's parameters. | ||
func (k Keeper) GetParams(ctx sdk.Context) types.Params { | ||
params := store.GetValue[*types.Params](ctx.KVStore(k.storeKey), types.KeyParams, "leverage params") | ||
if params == nil { | ||
panic("params not initialized") | ||
} | ||
return *params | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters