Documentation ¶
Index ¶
- func NewMsgServerImpl(keeper Keeper) types.MsgServer
- type Keeper
- func (k Keeper) ExpireOldStats(ctx sdk.Context)
- func (k Keeper) GetBlockStats(ctx sdk.Context) *types.BlockStats
- func (k Keeper) GetEpochStatsOrNil(ctx sdk.Context, epoch uint32) *types.EpochStats
- func (k Keeper) GetGlobalStats(ctx sdk.Context) *types.GlobalStats
- func (k Keeper) GetParams(ctx sdk.Context) (params types.Params)
- func (k Keeper) GetStatsMetadata(ctx sdk.Context) *types.StatsMetadata
- func (k Keeper) GetUserStats(ctx sdk.Context, address string) *types.UserStats
- func (k Keeper) GetWindowDuration(ctx sdk.Context) time.Duration
- func (k Keeper) GlobalStats(c context.Context, req *types.QueryGlobalStatsRequest) (*types.QueryGlobalStatsResponse, error)
- func (k Keeper) HasAuthority(authority string) bool
- func (k Keeper) InitializeForGenesis(ctx sdk.Context)
- func (k Keeper) Logger(ctx sdk.Context) log.Logger
- func (k Keeper) Params(c context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
- func (k Keeper) ProcessBlockStats(ctx sdk.Context)
- func (k Keeper) RecordFill(ctx sdk.Context, takerAddress string, makerAddress string, notional *big.Int)
- func (k Keeper) SetBlockStats(ctx sdk.Context, blockStats *types.BlockStats)
- func (k Keeper) SetEpochStats(ctx sdk.Context, epoch uint32, epochStats *types.EpochStats)
- func (k Keeper) SetGlobalStats(ctx sdk.Context, globalStats *types.GlobalStats)
- func (k Keeper) SetParams(ctx sdk.Context, params types.Params) error
- func (k Keeper) SetStatsMetadata(ctx sdk.Context, metadata *types.StatsMetadata)
- func (k Keeper) SetUserStats(ctx sdk.Context, address string, userStats *types.UserStats)
- func (k Keeper) StatsMetadata(c context.Context, req *types.QueryStatsMetadataRequest) (*types.QueryStatsMetadataResponse, error)
- func (k Keeper) UserStats(c context.Context, req *types.QueryUserStatsRequest) (*types.QueryUserStatsResponse, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewMsgServerImpl ¶
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 ¶
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 ¶
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) GetStatsMetadata ¶
func (k Keeper) GetStatsMetadata(ctx sdk.Context) *types.StatsMetadata
func (Keeper) GetUserStats ¶
func (Keeper) GlobalStats ¶
func (k Keeper) GlobalStats( c context.Context, req *types.QueryGlobalStatsRequest, ) ( *types.QueryGlobalStatsResponse, error, )
func (Keeper) HasAuthority ¶
func (Keeper) InitializeForGenesis ¶
func (Keeper) Params ¶
func (k Keeper) Params( c context.Context, req *types.QueryParamsRequest, ) ( *types.QueryParamsResponse, error, )
Params processes a query request/response for the Params from state.
func (Keeper) ProcessBlockStats ¶
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 (Keeper) SetGlobalStats ¶
func (k Keeper) SetGlobalStats(ctx sdk.Context, globalStats *types.GlobalStats)
func (Keeper) SetParams ¶
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 (Keeper) StatsMetadata ¶
func (k Keeper) StatsMetadata( c context.Context, req *types.QueryStatsMetadataRequest, ) ( *types.QueryStatsMetadataResponse, error, )
func (Keeper) UserStats ¶
func (k Keeper) UserStats( c context.Context, req *types.QueryUserStatsRequest, ) ( *types.QueryUserStatsResponse, error, )