* Refactor CliContext as Context
* Fix lint issues
* Fix goimports
* Fix gov tests
* Resolved ci-lint issues
* Add changelog
* Rename cliCtx to clientCtx
* Fix mocks and routes
* Add changelog
* Update changelog
* Apply suggestions from code review
Co-authored-by: Alessio Treglia <alessio@tendermint.com>
* merge client/rpc/ro{ot,utes}.go
* Update docs
* client/rpc: remove redundant client/rpc.RegisterRPCRoutes
* regenerate mocks
* Update ADRs
Co-authored-by: Alessio Treglia <alessio@tendermint.com>
Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
44 lines
1.4 KiB
Go
44 lines
1.4 KiB
Go
package keeper
|
|
|
|
import (
|
|
sdk "github.com/cosmos/cosmos-sdk/types"
|
|
"github.com/cosmos/cosmos-sdk/x/distribution/types"
|
|
)
|
|
|
|
// GetParams returns the total set of distribution parameters.
|
|
func (k Keeper) GetParams(clientCtx sdk.Context) (params types.Params) {
|
|
k.paramSpace.GetParamSet(clientCtx, ¶ms)
|
|
return params
|
|
}
|
|
|
|
// SetParams sets the distribution parameters to the param space.
|
|
func (k Keeper) SetParams(ctx sdk.Context, params types.Params) {
|
|
k.paramSpace.SetParamSet(ctx, ¶ms)
|
|
}
|
|
|
|
// GetCommunityTax returns the current distribution community tax.
|
|
func (k Keeper) GetCommunityTax(ctx sdk.Context) (percent sdk.Dec) {
|
|
k.paramSpace.Get(ctx, types.ParamStoreKeyCommunityTax, &percent)
|
|
return percent
|
|
}
|
|
|
|
// 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)
|
|
return percent
|
|
}
|
|
|
|
// 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)
|
|
return percent
|
|
}
|
|
|
|
// 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)
|
|
return enabled
|
|
}
|