keeper

package
v0.7.9-rc9 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2020 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Keeper

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

Keeper of the market store

func NewKeeper

func NewKeeper(cdc *codec.Codec, skey sdk.StoreKey) Keeper

NewKeeper creates and returns an instance for Market keeper

func (Keeper) Codec

func (k Keeper) Codec() *codec.Codec

Codec returns keeper codec

func (Keeper) CreateBid

func (k Keeper) CreateBid(ctx sdk.Context, oid types.OrderID, provider sdk.AccAddress, price sdk.Coin) (types.Bid, error)

CreateBid creates a bid for a order with given orderID, price for bid and provider

func (Keeper) CreateLease

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

CreateLease creates lease for bid with given bidID. Should only be called by the EndBlock handler or unit tests.

func (Keeper) CreateOrder

func (k Keeper) CreateOrder(ctx sdk.Context, gid dtypes.GroupID, spec dtypes.GroupSpec) (types.Order, error)

CreateOrder creates a new order with given group id and specifications. It returns created order

func (Keeper) GetBid

func (k Keeper) GetBid(ctx sdk.Context, id types.BidID) (types.Bid, bool)

GetBid returns bid with given bidID from market store

func (Keeper) GetLease

func (k Keeper) GetLease(ctx sdk.Context, id types.LeaseID) (types.Lease, bool)

GetLease returns lease with given leaseID from market store

func (Keeper) GetOrder

func (k Keeper) GetOrder(ctx sdk.Context, id types.OrderID) (types.Order, bool)

GetOrder returns order with given orderID from market store

func (Keeper) LeaseForOrder

func (k Keeper) LeaseForOrder(ctx sdk.Context, oid types.OrderID) (types.Lease, bool)

LeaseForOrder returns lease for order with given ID and lease found status

func (Keeper) OnBidClosed

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

OnBidClosed updates bid state to closed

func (Keeper) OnBidLost

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

OnBidLost updates bid state to bid lost

func (Keeper) OnBidMatched

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

OnBidMatched updates bid state to matched

func (Keeper) OnGroupClosed

func (k Keeper) OnGroupClosed(ctx sdk.Context, id dtypes.GroupID)

OnGroupClosed updates state of all orders, bids and leases in group to closed

func (Keeper) OnInsufficientFunds

func (k Keeper) OnInsufficientFunds(ctx sdk.Context, lease types.Lease)

OnInsufficientFunds updates lease state to insufficient funds

func (Keeper) OnLeaseClosed

func (k Keeper) OnLeaseClosed(ctx sdk.Context, lease types.Lease)

OnLeaseClosed updates lease state to closed

func (Keeper) OnOrderClosed

func (k Keeper) OnOrderClosed(ctx sdk.Context, order types.Order)

OnOrderClosed updates order state to closed

func (Keeper) OnOrderMatched

func (k Keeper) OnOrderMatched(ctx sdk.Context, order types.Order)

OnOrderMatched updates order state to matched

func (Keeper) WithActiveLeases added in v0.7.5

func (k Keeper) WithActiveLeases(ctx sdk.Context, fn func(types.Lease) bool)

WithActiveLeases iterates through all leases that were marked as Active and

func (Keeper) WithBids

func (k Keeper) WithBids(ctx sdk.Context, fn func(types.Bid) bool)

WithBids iterates all bids in market

func (Keeper) WithBidsForOrder

func (k Keeper) WithBidsForOrder(ctx sdk.Context, id types.OrderID, fn func(types.Bid) bool)

WithBidsForOrder iterates all bids of a order in market with given OrderID

func (Keeper) WithLeases

func (k Keeper) WithLeases(ctx sdk.Context, fn func(types.Lease) bool)

WithLeases iterates all leases in market

func (Keeper) WithOpenOrders added in v0.7.8

func (k Keeper) WithOpenOrders(ctx sdk.Context, fn func(types.Order) bool)

WithOpenOrders iterates all orders in market

func (Keeper) WithOrders

func (k Keeper) WithOrders(ctx sdk.Context, fn func(types.Order) bool)

WithOrders iterates all orders in market

func (Keeper) WithOrdersForGroup

func (k Keeper) WithOrdersForGroup(ctx sdk.Context, id dtypes.GroupID, fn func(types.Order) bool)

WithOrdersForGroup iterates all orders of a group in market with given GroupID

Jump to

Keyboard shortcuts

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