keeper

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2021 License: Apache-2.0 Imports: 21 Imported by: 36

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildFeedContext

func BuildFeedContext(ctx sdk.Context, k Keeper, feed types.Feed) (feedCtx types.FeedContext)

func NewMsgServerImpl added in v1.2.0

func NewMsgServerImpl(keeper Keeper) types.MsgServer

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

func NewQuerier

func NewQuerier(k Keeper, legacyQuerierCdc *codec.LegacyAmino) sdk.Querier

NewQuerier creates a querier for the oracle module

Types

type Keeper

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

Keeper

func NewKeeper

func NewKeeper(
	cdc codec.Marshaler,
	storeKey sdk.StoreKey,
	paramSpace paramtypes.Subspace,
	sk types.ServiceKeeper,
) Keeper

NewKeeper

func (Keeper) CreateFeed

func (k Keeper) CreateFeed(ctx sdk.Context, msg *types.MsgCreateFeed) error

CreateFeed create a stopped feed

func (Keeper) Dequeue

func (k Keeper) Dequeue(ctx sdk.Context, feedName string, state servicetypes.RequestContextState)

Dequeue will remove from the 'state' queue

func (Keeper) EditFeed

func (k Keeper) EditFeed(ctx sdk.Context, msg *types.MsgEditFeed) error

EditFeed edit a feed

func (Keeper) Enqueue

func (k Keeper) Enqueue(ctx sdk.Context, feedName string, state servicetypes.RequestContextState)

Enqueue will put feedName to a 'state' queue

func (Keeper) Feed

Feed queries a feed by feed name

func (Keeper) Feeds

func (Keeper) GetFeed

func (k Keeper) GetFeed(ctx sdk.Context, feedName string) (feed types.Feed, found bool)

GetFeed return the feed by feedName

func (Keeper) GetFeedByReqCtxID

func (k Keeper) GetFeedByReqCtxID(ctx sdk.Context, requestContextID tmbytes.HexBytes) (feed types.Feed, found bool)

GetFeedByReqCtxID return feed by requestContextID

func (Keeper) GetFeedValues

func (k Keeper) GetFeedValues(ctx sdk.Context, feedName string) (result types.FeedValues)

GetFeedValues return all feed values by feedName

func (Keeper) GetRequestContext

func (k Keeper) GetRequestContext(ctx sdk.Context, requestContextID tmbytes.HexBytes) (servicetypes.RequestContext, bool)

func (Keeper) HandlerResponse

func (k Keeper) HandlerResponse(
	ctx sdk.Context,
	requestContextID tmbytes.HexBytes,
	responseOutput []string,
	err error,
)

HandlerResponse is responsible for processing the data returned from the servicetypes module, processed by the aggregate function, and then saved

func (Keeper) HandlerStateChanged

func (k Keeper) HandlerStateChanged(ctx sdk.Context, requestContextID tmbytes.HexBytes, _ string)

HandlerStateChanged is responsible for update feed state

func (Keeper) IteratorFeeds

func (k Keeper) IteratorFeeds(ctx sdk.Context, fn func(feed types.Feed))

IteratorFeeds will foreach all feeds

func (Keeper) IteratorFeedsByState

func (k Keeper) IteratorFeedsByState(
	ctx sdk.Context,
	state servicetypes.RequestContextState,
	fn func(feed types.Feed),
)

IteratorFeedsByState will foreach all feeds by state

func (Keeper) ModuleServiceRequest

func (k Keeper) ModuleServiceRequest(ctx sdk.Context, input string) (result string, output string)

func (Keeper) PauseFeed

func (k Keeper) PauseFeed(ctx sdk.Context, msg *types.MsgPauseFeed) error

PauseFeed pause a running feed

func (Keeper) ResetFeedEntryState

func (k Keeper) ResetFeedEntryState(ctx sdk.Context) error

func (Keeper) SetFeed

func (k Keeper) SetFeed(ctx sdk.Context, feed types.Feed)

SetFeed will save a feed to store

func (Keeper) SetFeedValue

func (k Keeper) SetFeedValue(
	ctx sdk.Context,
	feedName string,
	batchCounter uint64,
	latestHistory uint64,
	value types.FeedValue,
)

SetFeedValue will save a feed result to store

func (Keeper) StartFeed

func (k Keeper) StartFeed(ctx sdk.Context, msg *types.MsgStartFeed) error

StartFeed start a stopped feed

type ValidateOracleAuthDecorator

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

func NewValidateOracleAuthDecorator

func NewValidateOracleAuthDecorator(k Keeper, ak types.AuthKeeper) ValidateOracleAuthDecorator

func (ValidateOracleAuthDecorator) AnteHandle

func (dtf ValidateOracleAuthDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool, next sdk.AnteHandler) (sdk.Context, error)

AnteHandle returns an AnteHandler that checks if the creator is authorized

Jump to

Keyboard shortcuts

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