keeper

package
v0.0.0-...-c736a29 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2021 License: AGPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	QueryListAuctions = "list"
	QueryGetAuction   = "get"
	QueryGetBid       = "get-bid"
	QueryGetBids      = "get-bids"
	QueryByOwner      = "query-by-owner"
	QueryParameters   = "parameters"
	QueryBalance      = "balance"
)

query endpoints supported by the auction Querier

View Source
const CompletedAuctionDeleteTimeout time.Duration = time.Hour * 24

CompletedAuctionDeleteTimeout => Completed auctions are deleted after this timeout (after reveals end time).

Variables

View Source
var PrefixAuctionBidsIndex = []byte{0x02}

PrefixAuctionBidsIndex is the prefix for the (auction, bidder) -> Bid index in the KVStore.

View Source
var PrefixIDToAuctionIndex = []byte{0x00}

PrefixIDToAuctionIndex is the prefix for ID -> Auction index in the KVStore. Note: This is the primary index in the system. Note: Golang doesn't support const arrays.

Functions

func AllInvariants

func AllInvariants(k Keeper) sdk.Invariant

AllInvariants runs all invariants of the auctions module.

func GetAuction

func GetAuction(store sdk.KVStore, codec *amino.Codec, id types.ID) *types.Auction

func GetAuctionBidsIndexPrefix

func GetAuctionBidsIndexPrefix(auctionID types.ID) []byte

func GetAuctionIndexKey

func GetAuctionIndexKey(id types.ID) []byte

Generates Auction ID -> Auction index key.

func GetBidIndexKey

func GetBidIndexKey(auctionID types.ID, bidder string) []byte

func GetBids

func GetBids(store sdk.KVStore, codec *amino.Codec, id types.ID) []*types.Bid

func GetOwnerToAuctionsIndexKey

func GetOwnerToAuctionsIndexKey(owner string, auctionID types.ID) []byte

Generates Owner -> Auctions index key.

func ModuleAccountInvariant

func ModuleAccountInvariant(k Keeper) sdk.Invariant

ModuleAccountInvariant checks that the 'auction' module account balance is non-negative.

func NewQuerier

func NewQuerier(keeper Keeper) sdk.Querier

NewQuerier is the module level router for state queries

func RegisterInvariants

func RegisterInvariants(ir sdk.InvariantRegistry, k Keeper)

RegisterInvariants registers all auction module invariants.

Types

type AuctionClientKeeper

type AuctionClientKeeper interface {
	HasAuction(ctx sdk.Context, id types.ID) bool
	GetAuction(ctx sdk.Context, id types.ID) types.Auction
	MatchAuctions(ctx sdk.Context, matchFn func(*types.Auction) bool) []*types.Auction
}

AuctionClientKeeper is the subset of functionality exposed to other modules.

type Keeper

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

Keeper maintains the link to storage and exposes getter/setter methods for the various parts of the state machine

func NewKeeper

func NewKeeper(accountKeeper auth.AccountKeeper, bankKeeper bank.Keeper, supplyKeeper supply.Keeper,
	storeKey sdk.StoreKey, cdc *codec.Codec, paramstore params.Subspace) Keeper

NewKeeper creates new instances of the auction Keeper

func (Keeper) CommitBid

func (k Keeper) CommitBid(ctx sdk.Context, msg types.MsgCommitBid) (*types.Auction, error)

CommitBid commits a bid for an auction.

func (Keeper) CreateAuction

func (k Keeper) CreateAuction(ctx sdk.Context, msg types.MsgCreateAuction) (*types.Auction, error)

CreateAuction creates a new auction.

func (Keeper) DeleteAuction

func (k Keeper) DeleteAuction(ctx sdk.Context, auction types.Auction)

DeleteAuction - deletes the auction.

func (Keeper) DeleteBid

func (k Keeper) DeleteBid(ctx sdk.Context, bid types.Bid)

func (Keeper) EndBlockerProcessAuctions

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

func (Keeper) GetAuction

func (k Keeper) GetAuction(ctx sdk.Context, id types.ID) *types.Auction

GetAuction - gets a record from the store.

func (Keeper) GetAuctionModuleBalances

func (k Keeper) GetAuctionModuleBalances(ctx sdk.Context) map[string]sdk.Coins

GetAuctionModuleBalances gets the auction module account(s) balances.

func (Keeper) GetBid

func (k Keeper) GetBid(ctx sdk.Context, id types.ID, bidder string) types.Bid

func (Keeper) GetBids

func (k Keeper) GetBids(ctx sdk.Context, id types.ID) []*types.Bid

GetBids gets the auction bids.

func (Keeper) GetParams

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

GetParams - Get all parameteras as types.Params.

func (Keeper) GetUsageKeepers

func (k Keeper) GetUsageKeepers() []types.AuctionUsageKeeper

func (Keeper) HasAuction

func (k Keeper) HasAuction(ctx sdk.Context, id types.ID) bool

HasAuction - checks if a auction by the given ID exists.

func (Keeper) HasBid

func (k Keeper) HasBid(ctx sdk.Context, id types.ID, bidder string) bool

func (Keeper) ListAuctions

func (k Keeper) ListAuctions(ctx sdk.Context) []types.Auction

ListAuctions - get all auctions.

func (Keeper) MatchAuctions

func (k Keeper) MatchAuctions(ctx sdk.Context, matchFn func(*types.Auction) bool) []*types.Auction

MatchAuctions - get all matching auctions.

func (Keeper) QueryAuctionsByOwner

func (k Keeper) QueryAuctionsByOwner(ctx sdk.Context, ownerAddress string) []types.Auction

QueryAuctionsByOwner - query auctions by owner.

func (Keeper) RevealBid

func (k Keeper) RevealBid(ctx sdk.Context, msg types.MsgRevealBid) (*types.Auction, error)

RevealBid reeals a bid comitted earlier.

func (Keeper) SaveAuction

func (k Keeper) SaveAuction(ctx sdk.Context, auction types.Auction)

SaveAuction - saves a auction to the store.

func (Keeper) SaveBid

func (k Keeper) SaveBid(ctx sdk.Context, bid types.Bid)

func (Keeper) SetParams

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

SetParams - set the params.

func (*Keeper) SetUsageKeepers

func (k *Keeper) SetUsageKeepers(usageKeepers []types.AuctionUsageKeeper)

Jump to

Keyboard shortcuts

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