keeper

package
v3.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 12, 2024 License: Apache-2.0 Imports: 38 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Test Account

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 CreateValidator(idx int, stake math.Int) (stakingtypes.Validator, error)

func GetPubKey

func GetPubKey(idx int) (sdkcrypto.PubKey, sdk.AccAddress, sdk.ValAddress)

func MakeEncodingConfig

func MakeEncodingConfig(_ *testing.T) simparams.EncodingConfig

MakeEncodingConfig

func MakeTestCodec

func MakeTestCodec(t *testing.T) codec.Codec

MakeTestCodec

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) GetCap

func (k Keeper) GetCap(ctx sdk.Context) (ret sdk.Dec)

func (Keeper) GetDynCommissionRate

func (k Keeper) GetDynCommissionRate(ctx sdk.Context, validator string) (rate sdk.Dec)

func (Keeper) GetMaxZero

func (k Keeper) GetMaxZero(ctx sdk.Context) (ret sdk.Dec)

func (Keeper) GetParams

func (k Keeper) GetParams(ctx sdk.Context) (params types.Params)

GetParams returns the total set of market parameters.

func (Keeper) GetSlopeBase

func (k Keeper) GetSlopeBase(ctx sdk.Context) (ret sdk.Dec)

func (Keeper) GetSlopeVpImpact

func (k Keeper) GetSlopeVpImpact(ctx sdk.Context) (ret sdk.Dec)

func (Keeper) GetTargetCommissionRate

func (k Keeper) GetTargetCommissionRate(ctx sdk.Context, validator string) (rate sdk.Dec)

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) Logger

func (k Keeper) Logger(ctx sdk.Context) log.Logger

Logger returns a module-specific logger.

func (Keeper) SetDynCommissionRate

func (k Keeper) SetDynCommissionRate(ctx sdk.Context, validator string, rate sdk.Dec)

func (Keeper) SetParams

func (k Keeper) SetParams(ctx sdk.Context, params types.Params)

SetParams sets the total set of market parameters.

func (Keeper) SetTargetCommissionRate

func (k Keeper) SetTargetCommissionRate(ctx sdk.Context, validator string, rate sdk.Dec)

func (Keeper) UpdateAllBondedValidatorRates

func (k Keeper) UpdateAllBondedValidatorRates(ctx sdk.Context) (err error)

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

func CreateTestInput(t *testing.T) TestInput

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL