Documentation ¶
Index ¶
- Variables
- func AddrFrom(idx int) sdk.AccAddress
- func CallCreateValidatorHooks(ctx sdk.Context, k distrkeeper.Keeper, addr sdk.AccAddress, ...) error
- func CreateValidator(idx int, stake math.Int) (stakingtypes.Validator, error)
- func GetPubKey(idx int) (sdkcrypto.PubKey, sdk.AccAddress, sdk.ValAddress)
- func MakeEncodingConfig(_ *testing.T) simparams.EncodingConfig
- func MakeTestCodec(t *testing.T) codec.Codec
- func NewLegacyQuerier(k Keeper, legacyQuerierCdc *codec.LegacyAmino) sdk.Querier
- func NewQuerier(keeper Keeper) types.QueryServer
- func ValAddrFrom(idx int) sdk.ValAddress
- type Keeper
- func (k Keeper) CalculateDynCommission(ctx sdk.Context, validator stakingtypes.Validator) (ret sdk.Dec)
- func (k Keeper) CalculateVotingPower(ctx sdk.Context, validator stakingtypes.Validator) (ret sdk.Dec)
- func (k Keeper) GetCap(ctx sdk.Context) (ret sdk.Dec)
- func (k Keeper) GetDynCommissionRate(ctx sdk.Context, validator string) (rate sdk.Dec)
- func (k Keeper) GetMaxZero(ctx sdk.Context) (ret sdk.Dec)
- func (k Keeper) GetParams(ctx sdk.Context) (params types.Params)
- func (k Keeper) GetSlopeBase(ctx sdk.Context) (ret sdk.Dec)
- func (k Keeper) GetSlopeVpImpact(ctx sdk.Context) (ret sdk.Dec)
- func (k Keeper) GetTargetCommissionRate(ctx sdk.Context, validator string) (rate sdk.Dec)
- func (k Keeper) IterateDynCommissionRates(ctx sdk.Context, cb func(types.ValidatorCommissionRate) bool)
- func (k Keeper) Logger(ctx sdk.Context) log.Logger
- func (k Keeper) SetDynCommissionRate(ctx sdk.Context, validator string, rate sdk.Dec)
- func (k Keeper) SetParams(ctx sdk.Context, params types.Params)
- func (k Keeper) SetTargetCommissionRate(ctx sdk.Context, validator string, rate sdk.Dec)
- func (k Keeper) UpdateAllBondedValidatorRates(ctx sdk.Context) (err error)
- func (k Keeper) UpdateValidatorMinRates(ctx sdk.Context, validator stakingtypes.Validator)
- type TestInput
Constants ¶
This section is empty.
Variables ¶
View Source
var ( PubKeys = simapp.CreateTestPubKeys(32) InitTokens = sdk.TokensFromConsensusPower(10_000, sdk.DefaultPowerReduction) InitCoins = sdk.NewCoins(sdk.NewCoin(core.MicroLunaDenom, InitTokens)) DelegateCoins = sdk.NewCoin(core.MicroLunaDenom, InitTokens) )
Test Account
View Source
var ModuleBasics = module.NewBasicManager( customauth.AppModuleBasic{}, custombank.AppModuleBasic{}, customstaking.AppModuleBasic{}, customdistr.AppModuleBasic{}, customparams.AppModuleBasic{}, )
Functions ¶
func AddrFrom ¶
func AddrFrom(idx int) sdk.AccAddress
func CallCreateValidatorHooks ¶
func CallCreateValidatorHooks(ctx sdk.Context, k distrkeeper.Keeper, addr sdk.AccAddress, valAddr sdk.ValAddress) error
func CreateValidator ¶
func GetPubKey ¶
func GetPubKey(idx int) (sdkcrypto.PubKey, sdk.AccAddress, sdk.ValAddress)
func MakeEncodingConfig ¶
func MakeEncodingConfig(_ *testing.T) simparams.EncodingConfig
MakeEncodingConfig
func NewLegacyQuerier ¶
func NewLegacyQuerier(k Keeper, legacyQuerierCdc *codec.LegacyAmino) sdk.Querier
NewLegacyQuerier is the module level router for state queries
func NewQuerier ¶
func NewQuerier(keeper Keeper) types.QueryServer
NewQuerier returns an implementation of the market QueryServer interface for the provided Keeper.
func ValAddrFrom ¶
func ValAddrFrom(idx int) sdk.ValAddress
Types ¶
type Keeper ¶
type Keeper struct { StakingKeeper types.StakingKeeper // contains filtered or unexported fields }
Keeper of the market store
func NewKeeper ¶
func NewKeeper( cdc codec.BinaryCodec, storeKey storetypes.StoreKey, paramstore paramstypes.Subspace, stakingKeeper types.StakingKeeper, ) Keeper
NewKeeper constructs a new keeper for oracle
func (Keeper) CalculateDynCommission ¶
func (k Keeper) CalculateDynCommission(ctx sdk.Context, validator stakingtypes.Validator) (ret sdk.Dec)
CalculateDynCommission calculates the min commission according to StrathColes formula
func (Keeper) CalculateVotingPower ¶
func (k Keeper) CalculateVotingPower(ctx sdk.Context, validator stakingtypes.Validator) (ret sdk.Dec)
GetVotingPower calculates the voting power of a validator in percent
func (Keeper) GetDynCommissionRate ¶
func (Keeper) GetTargetCommissionRate ¶
func (Keeper) IterateDynCommissionRates ¶
func (k Keeper) IterateDynCommissionRates(ctx sdk.Context, cb func(types.ValidatorCommissionRate) bool)
IterateDynCommissionRates iterates over dyn commission rates in the store
func (Keeper) SetDynCommissionRate ¶
func (Keeper) SetTargetCommissionRate ¶
func (Keeper) UpdateAllBondedValidatorRates ¶
func (Keeper) UpdateValidatorMinRates ¶
func (k Keeper) UpdateValidatorMinRates(ctx sdk.Context, validator stakingtypes.Validator)
type TestInput ¶
type TestInput struct { Ctx sdk.Context Cdc *codec.LegacyAmino AccountKeeper authkeeper.AccountKeeper BankKeeper bankkeeper.Keeper DistrKeeper distrkeeper.Keeper StakingKeeper stakingkeeper.Keeper DyncommKeeper Keeper }
func CreateTestInput ¶
Click to show internal directories.
Click to hide internal directories.