keeper

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2023 License: LGPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const CompletedAuctionDeleteTimeout = 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 PrefixBidderToAuctionsIndex = []byte{0x03}

PrefixBidderToAuctionsIndex is the prefix for the Bidder -> [Auction] 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 GetAuctionBidsIndexPrefix

func GetAuctionBidsIndexPrefix(auctionID string) []byte

func GetAuctionIndexKey

func GetAuctionIndexKey(id string) []byte

Generates Auction Id -> Auction index key.

func GetBidIndexKey

func GetBidIndexKey(auctionID string, bidder string) []byte

func GetBidderToAuctionsIndexKey

func GetBidderToAuctionsIndexKey(bidder string, auctionID string) []byte

func GetOwnerToAuctionsIndexKey

func GetOwnerToAuctionsIndexKey(owner string, auctionID string) []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 NewMsgServer

func NewMsgServer(keeper Keeper) types.MsgServer

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 string) bool
	GetAuction(ctx sdk.Context, id string) 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,
	storeKey storetypes.StoreKey,
	cdc codec.BinaryCodec,
	ps 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.Bid, error)

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 string) *types.Auction

GetAuction - gets a record from the store.

func (Keeper) GetAuctionModuleBalances

func (k Keeper) GetAuctionModuleBalances(ctx sdk.Context) sdk.Coins

GetAuctionModuleBalances gets the auction module account(s) balances.

func (Keeper) GetBid

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

func (Keeper) GetBids

func (k Keeper) GetBids(ctx sdk.Context, id string) []*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 string) bool

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

func (Keeper) HasBid

func (k Keeper) HasBid(ctx sdk.Context, id string, 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) QueryAuctionsByBidder

func (k Keeper) QueryAuctionsByBidder(ctx sdk.Context, bidderAddress string) []types.Auction

QueryAuctionsByBidder - query auctions by bidder

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 committed 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)

type Querier

type Querier struct {
	Keeper
}

func (Querier) Auctions

Auctions queries all auctions

func (Querier) AuctionsByBidder

AuctionsByBidder queries auctions by bidder

func (Querier) AuctionsByOwner

AuctionsByOwner queries auctions by owner

func (Querier) Balance

Balance queries the auction module account balance

func (Querier) GetAuction

GetAuction queries an auction

func (Querier) GetBid

func (q Querier) GetBid(c context.Context, req *types.BidRequest) (*types.BidResponse, error)

GetBid queries and auction bid

func (Querier) GetBids

GetBids queries all auction bids

func (Querier) QueryParams

QueryParams implements the params query command

Jump to

Keyboard shortcuts

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