keeper

package
v0.0.1-beta Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2024 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AllInvariants

func AllInvariants(k Keeper) sdk.Invariant

AllInvariants runs all invariants of the module.

func MismatchUsedAllocationsInvariant

func MismatchUsedAllocationsInvariant(k Keeper) sdk.Invariant

MismatchUsedAllocationsInvariant invariant that checks if the number of used allocations in `UsedAllocations` is different from the sum of per-auction used allocations in `AuctionUsedAllocations`

func NewMsgServerImpl

func NewMsgServerImpl(keeper Keeper) types.MsgServer

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

func NewQueryServerImpl

func NewQueryServerImpl(k Keeper) types.QueryServer

NewQueryServerImpl returns an implementation of the QueryServer interface for the provided Keeper.

func RegisterInvariants

func RegisterInvariants(ir sdk.InvariantRegistry, k Keeper)

RegisterInvariants registers all module invariants

Types

type Keeper

type Keeper struct {
	Schema                 collections.Schema
	Params                 collections.Item[types.Params]
	AuctionUsedAllocations collections.Map[collections.Pair[sdk.AccAddress, uint64], types.AuctionUsedAllocations]
	UsedAllocations        collections.Map[string, types.UsedAllocations]
	// contains filtered or unexported fields
}

func NewKeeper

func NewKeeper(
	cdc codec.BinaryCodec,
	addressCodec address.Codec,
	storeService store.KVStoreService,
	logger log.Logger,
	authority string,
	stakingKeeper types.StakingKeeper,
	fundraisingKeeper types.FundraisingKeeper,
) Keeper

func (Keeper) AddressCodec

func (k Keeper) AddressCodec() address.Codec

AddressCodec returns the address codec.

func (Keeper) AllAuctionUsedAllocations

func (k Keeper) AllAuctionUsedAllocations(ctx context.Context, address string) ([]types.AuctionUsedAllocations, error)

AllAuctionUsedAllocations returns all AuctionUsedAllocations.

func (Keeper) AllUsedAllocations

func (k Keeper) AllUsedAllocations(ctx context.Context) ([]types.UsedAllocations, error)

AllUsedAllocations returns all UsedAllocations.

func (Keeper) GetAuthority

func (k Keeper) GetAuthority() string

GetAuthority returns the module's authority.

func (Keeper) GetAvailableAllocations

func (k Keeper) GetAvailableAllocations(ctx context.Context, address string) (sdkmath.Int, error)

GetAvailableAllocations returns the number of allocations that are unused

func (Keeper) GetTotalAllocations

func (k Keeper) GetTotalAllocations(ctx context.Context, address string) (sdkmath.Int, error)

GetTotalAllocations returns the number of available allocations based on delegations

func (Keeper) IsRegistrationEnabled

func (k Keeper) IsRegistrationEnabled(ctx context.Context, auctionStartTime time.Time) (bool, error)

IsRegistrationEnabled returns true if the current block time is within the allowed registration period

func (Keeper) Logger

func (k Keeper) Logger() log.Logger

Logger returns a module-specific logger.

Jump to

Keyboard shortcuts

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