keeper

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2023 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMsgServerImpl

func NewMsgServerImpl(keeper Keeper) types.MsgServer

NewMsgServerImpl returns an implementation of the MsgServer interface for the provided Keeper.

Types

type Keeper

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

func NewKeeper

func NewKeeper(
	cdc codec.BinaryCodec,
	storeKey,
	memKey storetypes.StoreKey,

	authority string,

	accountKeeper types.AccountKeeper,
	bankKeeper util.BankKeeper,
	poolKeeper types.PoolKeeper,
	upgradeKeeper util.UpgradeKeeper,
) *Keeper

func (Keeper) ChargeFundersOfPool

func (k Keeper) ChargeFundersOfPool(ctx sdk.Context, poolId uint64) (payout uint64, err error)

ChargeFundersOfPool charges all funders of a pool with their amount_per_bundle If the amount is lower than the amount_per_bundle, the max amount is charged and the funder is removed from the active funders list. The amount is transferred from the funders to the pool module account where it can be paid out. If there are no more active funders, an event is emitted.

func (Keeper) CreateFundingState

func (k Keeper) CreateFundingState(ctx sdk.Context, poolId uint64)

func (Keeper) DoesFunderExist

func (k Keeper) DoesFunderExist(ctx sdk.Context, funderAddress string) bool

DoesFunderExist checks if the funding exists

func (Keeper) DoesFundingExist

func (k Keeper) DoesFundingExist(ctx sdk.Context, funderAddress string, poolId uint64) bool

DoesFundingExist checks if the funding exists

func (Keeper) DoesFundingStateExist

func (k Keeper) DoesFundingStateExist(ctx sdk.Context, poolId uint64) bool

DoesFundingStateExist checks if the FundingState exists

func (Keeper) GetActiveFundings

func (k Keeper) GetActiveFundings(ctx sdk.Context, fundingState types.FundingState) (fundings []types.Funding)

func (Keeper) GetAllFunders

func (k Keeper) GetAllFunders(ctx sdk.Context) (funders []types.Funder)

GetAllFunders returns all funders

func (Keeper) GetAllFundingStates

func (k Keeper) GetAllFundingStates(ctx sdk.Context) (fundingStates []types.FundingState)

GetAllFundingStates returns all FundingStates

func (Keeper) GetAllFundings

func (k Keeper) GetAllFundings(ctx sdk.Context) (fundings []types.Funding)

GetAllFundings returns all fundings

func (Keeper) GetFunder

func (k Keeper) GetFunder(ctx sdk.Context, funderAddress string) (funder types.Funder, found bool)

GetFunder returns the funder

func (Keeper) GetFunding

func (k Keeper) GetFunding(ctx sdk.Context, funderAddress string, poolId uint64) (funding types.Funding, found bool)

GetFunding returns the funding

func (Keeper) GetFundingState

func (k Keeper) GetFundingState(ctx sdk.Context, poolId uint64) (fundingState types.FundingState, found bool)

GetFundingState returns the FundingState

func (Keeper) GetFundingsOfFunder

func (k Keeper) GetFundingsOfFunder(ctx sdk.Context, funderAddress string) (fundings []types.Funding)

GetFundingsOfFunder returns all fundings of a funder

func (Keeper) GetFundingsOfPool

func (k Keeper) GetFundingsOfPool(ctx sdk.Context, poolId uint64) (fundings []types.Funding)

GetFundingsOfPool returns all fundings of a pool

func (Keeper) GetLowestFunding

func (k Keeper) GetLowestFunding(fundings []types.Funding) (lowestFunding *types.Funding, err error)

GetLowestFunding returns the funding with the lowest amount Precondition: len(fundings) > 0

func (Keeper) GetPaginatedFundersQuery

func (k Keeper) GetPaginatedFundersQuery(
	ctx sdk.Context,
	pagination *query.PageRequest,
	search string,
) ([]types.Funder, *query.PageResponse, error)

GetPaginatedFundersQuery performs a full search on all funders with the given parameters.

func (Keeper) GetPaginatedFundingQuery

func (k Keeper) GetPaginatedFundingQuery(
	ctx sdk.Context,
	pagination *query.PageRequest,
	funderAddress *string,
	poolId *uint64,
	fundingStatus queryTypes.FundingStatus,
) ([]types.Funding, *query.PageResponse, error)

GetPaginatedFundingQuery performs a full search on all fundings with the given parameters. Requires either funderAddress or poolId to be provided.

func (Keeper) GetParams

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

GetParams get all parameters as types.Params

func (Keeper) GetTotalActiveFunding

func (k Keeper) GetTotalActiveFunding(ctx sdk.Context, poolId uint64) (amount uint64)

func (Keeper) Logger

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

func (Keeper) Params

func (Keeper) SetFunder

func (k Keeper) SetFunder(ctx sdk.Context, funder *types.Funder)

SetFunder sets a specific funder in the store from its index

func (Keeper) SetFunding

func (k Keeper) SetFunding(ctx sdk.Context, funding *types.Funding)

SetFunding sets a specific funding in the store from its index

func (Keeper) SetFundingState

func (k Keeper) SetFundingState(ctx sdk.Context, fundingState *types.FundingState)

SetFundingState sets a specific FundingState in the store from its index

func (Keeper) SetParams

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

SetParams set the params

func (Keeper) StoreKey

func (k Keeper) StoreKey() storetypes.StoreKey

Jump to

Keyboard shortcuts

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