keeper

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2024 License: MIT Imports: 21 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,
	storeService store.KVStoreService,
	memService store.MemoryStoreService,
	logger log.Logger,

	authority string,

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

func (Keeper) ChargeFundersOfPool

func (k Keeper) ChargeFundersOfPool(ctx sdk.Context, poolId uint64, recipient string) (sdk.Coins, 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 recipient module account. If there are no more active funders, an event is emitted. This method only charges coins which are whitelisted.

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) GetCoinWhitelist added in v1.5.0

func (k Keeper) GetCoinWhitelist(ctx sdk.Context) (whitelist []types.WhitelistCoinEntry)

GetCoinWhitelist gets the coin whitelist from the params of the funding module

func (Keeper) GetCoinWhitelistMap added in v1.5.0

func (k Keeper) GetCoinWhitelistMap(ctx sdk.Context) (whitelist map[string]types.WhitelistCoinEntry)

GetCoinWhitelistMap gets the coin whitelist as a map with the denom as key for easier lookup. WARNING: Don't use this for setter functions since go maps are non-deterministic!

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(ctx sdk.Context, 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) (amounts sdk.Coins)

func (Keeper) Logger

func (k Keeper) Logger() 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

Jump to

Keyboard shortcuts

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