keeper

package
v1.7.3 Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2023 License: Apache-2.0 Imports: 21 Imported by: 3

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

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 defines a struct for the oracle keeper

func NewKeeper

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

NewKeeper returns an instance of the oracle Keeper

func (Keeper) CreateFeed

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

CreateFeed creates a stopped feed

func (Keeper) Dequeue

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

Dequeue removes the specified feed from the 'state' queue

func (Keeper) EditFeed

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

EditFeed edits a feed

func (Keeper) Enqueue

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

Enqueue puts the feed name to a 'state' queue

func (Keeper) Feed

Feed queries a feed by the feed name

func (Keeper) Feeds

func (Keeper) GetFeed

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

GetFeed returns the feed by the feed name

func (Keeper) GetFeedByReqCtxID

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

GetFeedByReqCtxID returns the feed by the request context ID

func (Keeper) GetFeedValues

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

GetFeedValues returns all feed values by the feed name

func (Keeper) GetRequestContext

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

func (Keeper) GetServiceKeeper

func (k Keeper) GetServiceKeeper() types.ServiceKeeper

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 service module, processed by the aggregation 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 iterates through all feeds

func (Keeper) IteratorFeedsByState

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

IteratorFeedsByState iterates through 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 pauses 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 saves a feed to store

func (Keeper) SetFeedValue

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

SetFeedValue saves a feed result to store

func (Keeper) StartFeed

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

StartFeed starts 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