2019-01-16 13:38:05 -08:00
|
|
|
package keeper
|
|
|
|
|
|
|
|
import (
|
|
|
|
sdk "github.com/cosmos/cosmos-sdk/types"
|
2020-01-10 12:08:14 -08:00
|
|
|
"github.com/cosmos/cosmos-sdk/x/distribution/types"
|
2019-01-16 13:38:05 -08:00
|
|
|
)
|
|
|
|
|
2020-01-10 12:08:14 -08:00
|
|
|
// GetParams returns the total set of distribution parameters.
|
2020-06-01 05:46:03 -07:00
|
|
|
func (k Keeper) GetParams(clientCtx sdk.Context) (params types.Params) {
|
|
|
|
k.paramSpace.GetParamSet(clientCtx, ¶ms)
|
2020-01-10 12:08:14 -08:00
|
|
|
return params
|
2019-12-10 08:48:57 -08:00
|
|
|
}
|
|
|
|
|
2020-01-10 12:08:14 -08:00
|
|
|
// SetParams sets the distribution parameters to the param space.
|
|
|
|
func (k Keeper) SetParams(ctx sdk.Context, params types.Params) {
|
|
|
|
k.paramSpace.SetParamSet(ctx, ¶ms)
|
2019-12-10 08:48:57 -08:00
|
|
|
}
|
|
|
|
|
2020-01-10 12:08:14 -08:00
|
|
|
// GetCommunityTax returns the current distribution community tax.
|
|
|
|
func (k Keeper) GetCommunityTax(ctx sdk.Context) (percent sdk.Dec) {
|
|
|
|
k.paramSpace.Get(ctx, types.ParamStoreKeyCommunityTax, &percent)
|
2019-01-16 13:38:05 -08:00
|
|
|
return percent
|
|
|
|
}
|
|
|
|
|
2020-01-10 12:08:14 -08:00
|
|
|
// GetBaseProposerReward returns the current distribution base proposer rate.
|
|
|
|
func (k Keeper) GetBaseProposerReward(ctx sdk.Context) (percent sdk.Dec) {
|
|
|
|
k.paramSpace.Get(ctx, types.ParamStoreKeyBaseProposerReward, &percent)
|
2019-01-16 13:38:05 -08:00
|
|
|
return percent
|
|
|
|
}
|
|
|
|
|
2020-01-10 12:08:14 -08:00
|
|
|
// GetBonusProposerReward returns the current distribution bonus proposer reward
|
|
|
|
// rate.
|
|
|
|
func (k Keeper) GetBonusProposerReward(ctx sdk.Context) (percent sdk.Dec) {
|
|
|
|
k.paramSpace.Get(ctx, types.ParamStoreKeyBonusProposerReward, &percent)
|
2019-01-16 13:38:05 -08:00
|
|
|
return percent
|
|
|
|
}
|
|
|
|
|
2020-01-10 12:08:14 -08:00
|
|
|
// GetWithdrawAddrEnabled returns the current distribution withdraw address
|
|
|
|
// enabled parameter.
|
|
|
|
func (k Keeper) GetWithdrawAddrEnabled(ctx sdk.Context) (enabled bool) {
|
|
|
|
k.paramSpace.Get(ctx, types.ParamStoreKeyWithdrawAddrEnabled, &enabled)
|
2019-01-16 14:17:56 -08:00
|
|
|
return enabled
|
|
|
|
}
|