keepers

package
v0.0.0-...-b1b35ba Latest Latest
Warning

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

Go to latest
Published: May 6, 2020 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	QueryPool       = "pool"
	QueryParameters = "parameters"
)

Query endpoints supported by the slashing querier

Variables

View Source
var (
	NonBondableAddressesKey = []byte("0x01")
)

Functions

func CalcBondedRatio

func CalcBondedRatio(p *BondPool) sdk.Dec

func NewQuerier

func NewQuerier(k Keeper, cdc *codec.Codec) sdk.Querier

Types

type AssetViewKeeper

type AssetViewKeeper interface {
	GetToken(ctx sdk.Context, symbol string) asset.Token
}

type BondPool

type BondPool struct {
	NotBondedTokens   sdk.Int `json:"not_bonded_tokens"`   // tokens which are not bonded to a validator (unbonded or unbonding)
	BondedTokens      sdk.Int `json:"bonded_tokens"`       // tokens which are currently bonded to a validator
	NonBondableTokens sdk.Int `json:"non_bondable_tokens"` // tokens which are in locked positions and non-bondable
	TotalSupply       sdk.Int `json:"total_supply"`        // total token supply
	BondRatio         sdk.Dec `json:"bonded_ratio"`        // bonded ratio
}

type DistributionKeeper

type DistributionKeeper interface {
	GetFeePool(ctx sdk.Context) (feePool types.FeePool)
	SetFeePool(ctx sdk.Context, feePool types.FeePool)
	GetFeePoolCommunityCoins(ctx sdk.Context) sdk.DecCoins

	IterateValidatorOutstandingRewards(ctx sdk.Context, handler func(val sdk.ValAddress, rewards types.ValidatorOutstandingRewards) (stop bool))
}

type ExpectBankxKeeper

type ExpectBankxKeeper interface {
	TotalAmountOfCoin(ctx sdk.Context, denom string) sdk.Int
}

type ExpectSupplyKeeper

type ExpectSupplyKeeper interface {
	GetModuleAccount(ctx sdk.Context, name string) supply.ModuleAccountI
	GetSupply(ctx sdk.Context) (supply supply.SupplyI)
}

type Keeper

type Keeper struct {
	// contains filtered or unexported fields
}

func NewKeeper

func NewKeeper(key sdk.StoreKey, cdc *codec.Codec,
	paramSubspace params.Subspace, assetViewKeeper AssetViewKeeper, sk *staking.Keeper,
	dk DistributionKeeper, ak auth.AccountKeeper, bk ExpectBankxKeeper,
	supplyKeeper ExpectSupplyKeeper, feeCollectorName string) Keeper

func (Keeper) CalcBondPoolStatus

func (k Keeper) CalcBondPoolStatus(ctx sdk.Context) BondPool

func (Keeper) GetAllVestingAccountAddresses

func (k Keeper) GetAllVestingAccountAddresses(ctx sdk.Context) []sdk.AccAddress

func (Keeper) GetCetOwnerAddress

func (k Keeper) GetCetOwnerAddress(ctx sdk.Context) sdk.AccAddress

func (Keeper) GetMinMandatoryCommissionRate

func (k Keeper) GetMinMandatoryCommissionRate(ctx sdk.Context) (rate sdk.Dec)

func (Keeper) GetParams

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

GetParams gets the asset module's parameters.

func (Keeper) SetNonBondableAddresses

func (k Keeper) SetNonBondableAddresses(ctx sdk.Context, addresses []sdk.AccAddress)

func (Keeper) SetParams

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

SetParams sets the asset module's parameters.

type MockKeeper

type MockKeeper struct {
	Keeper
	Sk           *staking.Keeper
	Dk           DistributionKeeper
	Ak           auth.AccountKeeper
	Bk           ExpectBankxKeeper
	SupplyKeeper ExpectSupplyKeeper
}

func InitStates

func InitStates(ctx sdk.Context, sxk Keeper, ak auth.AccountKeeper, splk supply.Keeper) MockKeeper

Jump to

Keyboard shortcuts

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