keeper

package
v0.21.0 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2020 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultParamspace = types.ModuleName
)

Default parameter namespace

Variables

M is global metric variable.

Functions

func NewQuerier

func NewQuerier(k Keeper) sdk.Querier

NewQuerier creates a new querier for execution clients.

Types

type Keeper

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

Keeper of the execution store

func NewKeeper

func NewKeeper(cdc *codec.Codec, key sdk.StoreKey, bankKeeper types.BankKeeper, serviceKeeper types.ServiceKeeper, instanceKeeper types.InstanceKeeper, runnerKeeper types.RunnerKeeper, processKeeper types.ProcessKeeper, paramstore params.Subspace) Keeper

NewKeeper creates a execution keeper

func (*Keeper) Create

func (k *Keeper) Create(ctx sdk.Context, msg types.MsgCreate) (*executionpb.Execution, error)

Create creates a new execution with proposed status. The execution reaches consensus only when more than 2/3 of emitters proposed the same execution. TODO: we should split the message and keeper function of execution create from user and for process.

func (*Keeper) Get

func (k *Keeper) Get(ctx sdk.Context, hash hash.Hash) (*executionpb.Execution, error)

Get returns the execution that matches given hash.

func (Keeper) GetParams

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

GetParams returns all the params of the module

func (*Keeper) List

func (k *Keeper) List(ctx sdk.Context) ([]*executionpb.Execution, error)

List returns all executions.

func (Keeper) Logger

func (k Keeper) Logger(ctx sdk.Context) log.Logger

Logger returns a module-specific logger.

func (Keeper) MinPrice

func (k Keeper) MinPrice(ctx sdk.Context) string

MinPrice - Minimum price of an execution

func (Keeper) SetParams

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

SetParams will populate all the params

func (*Keeper) Update

func (k *Keeper) Update(ctx sdk.Context, msg types.MsgUpdate) (*executionpb.Execution, error)

Update updates a new execution from definition.

type Metric

type Metric struct {
	Created    metrics.Counter
	InProgress metrics.Counter
	Updated    metrics.Counter
	Completed  metrics.Counter
}

Metric is struct to keep counters for execution statuses.

func NewMetric

func NewMetric() *Metric

NewMetric creates a counters metric.

Jump to

Keyboard shortcuts

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