Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Actor ¶ added in v0.2.6
type Actor = string
func FindTopNByScoreDesc ¶ added in v0.2.6
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 ¶ added in v0.2.6
type BlockHeight = int64
type PriorityQueue ¶ added in v0.2.6
type PriorityQueue []*SortableItem
func (PriorityQueue) Len ¶ added in v0.2.6
func (pq PriorityQueue) Len() int
func (PriorityQueue) Less ¶ added in v0.2.6
func (pq PriorityQueue) Less(i, j int) bool
func (*PriorityQueue) Pop ¶ added in v0.2.6
func (pq *PriorityQueue) Pop() any
func (*PriorityQueue) Push ¶ added in v0.2.6
func (pq *PriorityQueue) Push(x any)
func (PriorityQueue) Swap ¶ added in v0.2.6
func (pq PriorityQueue) Swap(i, j int)
type SortableItem ¶ added in v0.2.6
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
Click to show internal directories.
Click to hide internal directories.