msgserver

package
v0.2.11 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMsgServerImpl

func NewMsgServerImpl(keeper keeper.Keeper) types.MsgServer

NewMsgServerImpl returns an implementation of the module MsgServer interface.

Types

type Actor

type Actor = string

func FindTopNByScoreDesc

func FindTopNByScoreDesc(n uint64, scoresByActor map[Actor]Score, randSeed BlockHeight) []Actor

Sorts the given actors by score, desc, breaking ties randomly Returns the top N actors as a map with the actor as the key and a boolean (True) as the value

type Allo

type Allo = cosmosMath.Int

type BlockHeight

type BlockHeight = int64

type PriorityQueue

type PriorityQueue []*SortableItem

func (PriorityQueue) Len

func (pq PriorityQueue) Len() int

func (PriorityQueue) Less

func (pq PriorityQueue) Less(i, j int) bool

func (*PriorityQueue) Pop

func (pq *PriorityQueue) Pop() any

func (*PriorityQueue) Push

func (pq *PriorityQueue) Push(x any)

func (PriorityQueue) Swap

func (pq PriorityQueue) Swap(i, j int)

type Score

type Score = types.Score

type SortableItem

type SortableItem struct {
	Value      Actor
	Weight     Score
	Tiebreaker uint32
	// contains filtered or unexported fields
}

A structure to hold the original value and a random tiebreaker

type TopicId

type TopicId = uint64

Jump to

Keyboard shortcuts

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