keeper

package
v0.0.0-...-cc24d94 Latest Latest
Warning

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

Go to latest
Published: Dec 25, 2023 License: AGPL-3.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 MsgServer interface for the provided Keeper.

Types

type Keeper

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

func NewKeeper

func NewKeeper(
	cdc codec.BinaryCodec,
	epochsKeeper types.EpochsKeeper,
	storeKey storetypes.StoreKey,
	transientStoreKey storetypes.StoreKey,
	authorities []string,
) *Keeper

func (Keeper) ExpireOldStats

func (k Keeper) ExpireOldStats(ctx sdk.Context)

ExpireOldStats expiration of stats when they fall out of the window. TrailingEpoch is next epoch that can potentially fall out of the window. Attempt to expire the next epoch. TrailingEpoch will be advanced at most once.

func (Keeper) GetBlockStats

func (k Keeper) GetBlockStats(ctx sdk.Context) *types.BlockStats

func (Keeper) GetEpochStatsOrNil

func (k Keeper) GetEpochStatsOrNil(ctx sdk.Context, epoch uint32) *types.EpochStats

GetEpochStatsOrNil returns the EpochStats for an epoch. This function returns nil if epoch stats aren't found.

func (Keeper) GetGlobalStats

func (k Keeper) GetGlobalStats(ctx sdk.Context) *types.GlobalStats

func (Keeper) GetParams

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

GetParams returns the Params in state.

func (Keeper) GetStatsMetadata

func (k Keeper) GetStatsMetadata(ctx sdk.Context) *types.StatsMetadata

func (Keeper) GetUserStats

func (k Keeper) GetUserStats(ctx sdk.Context, address string) *types.UserStats

func (Keeper) GetWindowDuration

func (k Keeper) GetWindowDuration(ctx sdk.Context) time.Duration

func (Keeper) GlobalStats

func (Keeper) HasAuthority

func (k Keeper) HasAuthority(authority string) bool

func (Keeper) InitializeForGenesis

func (k Keeper) InitializeForGenesis(ctx sdk.Context)

func (Keeper) Logger

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

func (Keeper) Params

Params processes a query request/response for the Params from state.

func (Keeper) ProcessBlockStats

func (k Keeper) ProcessBlockStats(ctx sdk.Context)

ProcessBlockStats persists the info from this block's BlockStats this epoch's stats. It also appropriately increments the overall stats globally and for each user

func (Keeper) RecordFill

func (k Keeper) RecordFill(ctx sdk.Context, takerAddress string, makerAddress string, notional *big.Int)

Record a match in BlockStats, which is stored in the transient store

func (Keeper) SetBlockStats

func (k Keeper) SetBlockStats(ctx sdk.Context, blockStats *types.BlockStats)

func (Keeper) SetEpochStats

func (k Keeper) SetEpochStats(ctx sdk.Context, epoch uint32, epochStats *types.EpochStats)

func (Keeper) SetGlobalStats

func (k Keeper) SetGlobalStats(ctx sdk.Context, globalStats *types.GlobalStats)

func (Keeper) SetParams

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

SetParams updates the Params in state. Returns an error iff validation fails.

func (Keeper) SetStatsMetadata

func (k Keeper) SetStatsMetadata(ctx sdk.Context, metadata *types.StatsMetadata)

func (Keeper) SetUserStats

func (k Keeper) SetUserStats(ctx sdk.Context, address string, userStats *types.UserStats)

func (Keeper) UserStats

Jump to

Keyboard shortcuts

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