keeper

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2023 License: MIT Imports: 21 Imported by: 4

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.

func SetStakersKeeper

func SetStakersKeeper(k *Keeper, stakersKeeper types.StakersKeeper)

Types

type Keeper

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

func NewKeeper

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

	authority string,

	accountKeeper authkeeper.AccountKeeper,
	bankKeeper bankkeeper.Keeper,
	distrKeeper distrkeeper.Keeper,
	upgradeKeeper types.UpgradeKeeper,
) *Keeper

func (Keeper) AppendPool

func (k Keeper) AppendPool(ctx sdk.Context, pool types.Pool) uint64

AppendPool appends a pool in the store with a new id and updates the count

func (Keeper) AssertPoolExists

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

AssertPoolExists returns nil if the pool exists and types.ErrPoolNotFound if it does not.

func (Keeper) ChargeFundersOfPool

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

ChargeFundersOfPool equally splits the amount between all funders and removes the appropriate amount from each funder. All funders who can't afford the amount, are kicked out. Their remaining amount is transferred to the Treasury. The function throws an error if pool ran out of funds. This method does not transfer any funds. The bundles-module is responsible for transferring the rewards out of the module.

func (Keeper) GetAllPools

func (k Keeper) GetAllPools(ctx sdk.Context) (list []types.Pool)

GetAllPools returns all pools

func (Keeper) GetPaginatedPoolsQuery

func (k Keeper) GetPaginatedPoolsQuery(
	ctx sdk.Context,
	pagination *query.PageRequest,
	search string,
	runtime string,
	disabled bool,
	storageProviderId uint32,
) ([]types.Pool, *query.PageResponse, error)

GetPaginatedPoolsQuery performs a full search on all pools with the given parameters.

func (Keeper) GetPool

func (k Keeper) GetPool(ctx sdk.Context, id uint64) (val types.Pool, found bool)

GetPool returns a pool from its ID

func (Keeper) GetPoolCount

func (k Keeper) GetPoolCount(ctx sdk.Context) uint64

GetPoolCount get the total number of pools

func (Keeper) GetPoolWithError

func (k Keeper) GetPoolWithError(ctx sdk.Context, poolId uint64) (types.Pool, error)

GetPoolWithError returns a pool by its poolId, if the pool does not exist, a types.ErrPoolNotFound error is returned

func (Keeper) HandlePoolUpgrades

func (k Keeper) HandlePoolUpgrades(ctx sdk.Context)

HandlePoolUpgrades handles to end-block logic for detecting and performing schedules pool-upgrades.

func (Keeper) IncrementBundleInformation

func (k Keeper) IncrementBundleInformation(
	ctx sdk.Context,
	poolId uint64,
	currentIndex uint64,
	currentKey string,
	currentSummary string,
)

IncrementBundleInformation updates the latest finalized bundle of a pool

func (Keeper) Logger

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

func (Keeper) RemovePool

func (k Keeper) RemovePool(ctx sdk.Context, id uint64)

RemovePool removes a pool from the store

func (Keeper) SetPool

func (k Keeper) SetPool(ctx sdk.Context, pool types.Pool)

SetPool sets a specific pool in the store

func (Keeper) SetPoolCount

func (k Keeper) SetPoolCount(ctx sdk.Context, count uint64)

SetPoolCount sets the total number of pools

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