handler

package
v0.9.0-rc5 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2020 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoBids = errors.New("no bids to pick winner from")

Functions

func NewHandler

func NewHandler(keepers Keepers) sdk.Handler

NewHandler returns a handler for "market" type messages

func NewMsgServerImpl added in v0.9.1

func NewMsgServerImpl(k Keepers) types.MsgServer

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

func OnEndBlock

func OnEndBlock(ctx sdk.Context, keepers Keepers) error

OnEndBlock transfer funds for active leases and update order states Executed at the end of block

func PickBidWinner added in v0.9.1

func PickBidWinner(bids []types.Bid) (winner *types.Bid, err error)

Types

type AuditKeeper added in v0.9.1

type AuditKeeper interface {
	GetProviderAttributes(ctx sdk.Context, id sdk.Address) (atypes.Providers, bool)
}

type DeploymentKeeper

type DeploymentKeeper interface {
	GetGroup(ctx sdk.Context, id dtypes.GroupID) (dtypes.Group, bool)
	OnLeaseCreated(ctx sdk.Context, id dtypes.GroupID)
	OnLeaseInsufficientFunds(ctx sdk.Context, id dtypes.GroupID)
	OnLeaseClosed(ctx sdk.Context, id dtypes.GroupID)
}

DeploymentKeeper Interface includes deployment methods

type Keepers

type Keepers struct {
	Market     keeper.Keeper
	Deployment DeploymentKeeper
	Provider   ProviderKeeper
	Audit      AuditKeeper
	Bank       bankkeeper.Keeper
}

Keepers include all modules keepers

type ProviderKeeper

type ProviderKeeper interface {
	Get(ctx sdk.Context, id sdk.Address) (ptypes.Provider, bool)
	WithProviders(ctx sdk.Context, fn func(ptypes.Provider) bool)
}

ProviderKeeper Interface includes provider methods

Jump to

Keyboard shortcuts

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