mirror of
https://github.com/0glabs/0g-chain.git
synced 2024-12-24 23:35:19 +00:00
a073238f34
* module files * proto types * types and generated proto types * keeper * client scaffold * add savings module to app * remove placeholder types file * implement rest and add to module * update proto types * validation for supported denoms * generate updates proto types * update comments * update comments * remove unused imports from proto files * regenerate proto files * update proto types * client * deposit type and generated proto types * deposit keeper methods + tests * update savings module file * update app.go + test common * remove abci * remove refs to other modules * remove endblocker call * genesis init test for module account * update genesis test with params * add get/set params test * fix up keeper test * use params getter * simplify if/else statement * fix: add msgServer to keeper * fix: register deposit message * update deposit test * wrap invalid deposit denom error msg Co-authored-by: karzak <kjydavis3@gmail.com>
31 lines
730 B
Go
31 lines
730 B
Go
package keeper
|
|
|
|
import (
|
|
sdk "github.com/cosmos/cosmos-sdk/types"
|
|
|
|
"github.com/kava-labs/kava/x/savings/types"
|
|
)
|
|
|
|
// GetParams returns the params from the store
|
|
func (k Keeper) GetParams(ctx sdk.Context) types.Params {
|
|
var p types.Params
|
|
k.paramSubspace.GetParamSet(ctx, &p)
|
|
return p
|
|
}
|
|
|
|
// SetParams sets params on the store
|
|
func (k Keeper) SetParams(ctx sdk.Context, params types.Params) {
|
|
k.paramSubspace.SetParamSet(ctx, ¶ms)
|
|
}
|
|
|
|
// IsDenomSupported returns a boolean indicating if a denom is supported
|
|
func (k Keeper) IsDenomSupported(ctx sdk.Context, denom string) bool {
|
|
p := k.GetParams(ctx)
|
|
for _, supportedDenom := range p.SupportedDenoms {
|
|
if supportedDenom == denom {
|
|
return true
|
|
}
|
|
}
|
|
return false
|
|
}
|