Search Apps Documentation Source Content File Folder Download Copy Actions Download State String Boolean Number Struct Map Slice Pointer Function Closure Reference Nil Package Type Interface Unknown

v1 state

Back to all declarations

player

type

player holds the accumulated state for a single address.

Value

v1.player

players

v0.Tree

players maps address string -> \*player. An avl.Tree gives deterministic iteration (unlike a Go map) so Render output is stable across nodes.

Open
OID
029cad…075b:4
players details

Inspect ref

get

func(addr .uverse.address) *v1.player

get returns the stored \*player for addr, creating one if absent.

Open
OID
029cad…075b:5
get details

Inspect func

AddPoints

func(n int)

AddPoints adds n points to the caller's total. n must be positive. Crossing function: MsgCall dispatches only to crossing functions, and the cur.IsCurrent() check authenticates the live call frame before we trust the caller identity derived from it.

Open
OID
029cad…075b:8
AddPoints details

Inspect func

SetName

func(name string)

SetName attaches a display name (max 32 bytes) to the caller. Passing an empty string clears the name and falls back to the address in Render.

Open
OID
029cad…075b:9
SetName details

Inspect func

byRank

type

byRank implements sort.Interface, ranking players by points descending with ties broken by address so the order is deterministic across nodes. The gno sort package exposes Sort/Stable over an Interface — there is no sort.Slice.

Value

v1.byRank

snapshot

func() []*v1.player

snapshot collects all players into a slice ranked by points descending.

Open
OID
029cad…075b:10
snapshot details

Inspect func

Render

func(path string) string

Render produces the Markdown leaderboard. It is NOT a crossing function (read-only view, no cur realm parameter).

Open
OID
029cad…075b:11
Render details

Inspect func
player : type =v1.player
players : v0.Tree Inspect
get : func(addr .uverse.address) *v1.player Inspect
caller : func() .uverse.address Inspect
AddPoints : func(n int) Inspect
SetName : func(name string) Inspect
byRank : type =v1.byRank
snapshot : func() []*v1.player Inspect
Render : func(path string) string Inspect