keeper

package
v1.7.4 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2023 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMsgServerImpl

func NewMsgServerImpl(keeper Keeper) types.MsgServer

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

func NewQuerier

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

NewQuerier creates a new random Querier instance

Types

type Keeper

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

Keeper defines the random module Keeper

func NewKeeper

func NewKeeper(cdc codec.Codec, key storetypes.StoreKey, bankKeeper types.BankKeeper, serviceKeeper types.ServiceKeeper) Keeper

NewKeeper returns a new random keeper

func (Keeper) DeleteOracleRandRequest

func (k Keeper) DeleteOracleRandRequest(ctx sdk.Context, requestContextID []byte)

DeleteOracleRandRequest deletes an oracle random number request

func (Keeper) DequeueRandomRequest

func (k Keeper) DequeueRandomRequest(ctx sdk.Context, height int64, reqID []byte)

DequeueRandomRequest removes the random number request by the specified height and request id

func (Keeper) EnqueueRandomRequest

func (k Keeper) EnqueueRandomRequest(ctx sdk.Context, height int64, reqID []byte, request types.Request)

EnqueueRandomRequest enqueues the random number request

func (Keeper) GetCdc

func (k Keeper) GetCdc() codec.BinaryCodec

GetCdc returns the cdc

func (Keeper) GetMaxServiceRequestTimeout

func (k Keeper) GetMaxServiceRequestTimeout(ctx sdk.Context) int64

GetMaxServiceRequestTimeout returns MaxServiceRequestTimeout

func (Keeper) GetOracleRandRequest

func (k Keeper) GetOracleRandRequest(ctx sdk.Context, requestContextID []byte) (types.Request, error)

GetOracleRandRequest retrieves the oracle random number request by the specified request id

func (Keeper) GetRandom

func (k Keeper) GetRandom(ctx sdk.Context, reqID []byte) (types.Random, error)

GetRandom retrieves the random number by the specified request id

func (Keeper) GetRequestContext

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

GetRequestContext retrieves the request context by the specified request context id

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

func (Keeper) HandlerStateChanged

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

func (Keeper) IterateRandomRequestQueue

func (k Keeper) IterateRandomRequestQueue(ctx sdk.Context, op func(h int64, reqID []byte, r types.Request) (stop bool))

IterateRandomRequestQueue iterates through the random number request queue

func (Keeper) IterateRandomRequestQueueByHeight

func (k Keeper) IterateRandomRequestQueueByHeight(ctx sdk.Context, height int64) sdk.Iterator

IterateRandomRequestQueueByHeight iterates through the random number request queue by the specified height

func (Keeper) IterateRandoms

func (k Keeper) IterateRandoms(ctx sdk.Context, op func(r types.Random) (stop bool))

IterateRandoms iterates through all the random numbers

func (Keeper) Logger

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

Logger returns a module-specific logger.

func (Keeper) Random

Random implements the Query/Random gRPC method

func (Keeper) RandomRequestQueue

RandomRequestQueue implements the Query/RandomRequestQueue gRPC method

func (Keeper) RequestRandom

func (k Keeper) RequestRandom(
	ctx sdk.Context, consumer sdk.AccAddress,
	blockInterval uint64, oracle bool,
	serviceFeeCap sdk.Coins,
) (types.Request, error)

RequestRandom requests a random number

func (Keeper) RequestService

func (k Keeper) RequestService(ctx sdk.Context, consumer sdk.AccAddress, serviceFeeCap sdk.Coins) (tmbytes.HexBytes, error)

RequestService requests the service for the oracle seed

func (Keeper) SetOracleRandRequest

func (k Keeper) SetOracleRandRequest(ctx sdk.Context, requestContextID []byte, request types.Request)

SetOracleRandRequest stores the oracle random number request

func (Keeper) SetRandom

func (k Keeper) SetRandom(ctx sdk.Context, reqID []byte, random types.Random)

SetRandom stores the random number

func (Keeper) StartRequestContext

func (k Keeper) StartRequestContext(
	ctx sdk.Context,
	serviceContextID tmbytes.HexBytes,
	consumer sdk.AccAddress,
) error

StartRequestContext starts the service context

Jump to

Keyboard shortcuts

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