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

v0 state

Back to all declarations

graceBlocks

int64

graceBlocks is the max block gap between two check-ins that still counts as consecutive. A gap larger than this lapses the streak.

Value

100

record

type

record is the persisted streak state for one address.

Value

v0.record

streaks

v0.Tree

// owner address string -> \*record

Open
OID
0c29cf…bc71:4
streaks details

Inspect ref

get

func(owner .uverse.address) (*v0.record, bool)
Open
OID
0c29cf…bc71:5
get details

Inspect func

project

func(r *v0.record, height int64) (current int64, alive bool)

project reports the record's current streak as of height without mutating it: once the gap since lastHeight exceeds graceBlocks the streak reads as lapsed, even though the stored value only resets on the next actual check-in.

Open
OID
0c29cf…bc71:7
project details

Inspect func

checkin

func(owner .uverse.address, height int64) string

checkin is the non-crossing core of CheckIn, kept separate so unit tests can drive it directly by address and height.

Open
OID
0c29cf…bc71:8
checkin details

Inspect func

CheckIn

func() string

CheckIn records a check-in for the caller at the current block height.

Open
OID
0c29cf…bc71:9
CheckIn details

Inspect func

CurrentStreak

func(addr string) int64

CurrentStreak returns addr's live current streak, 0 if it has lapsed or addr has never checked in.

Open
OID
0c29cf…bc71:10
CurrentStreak details

Inspect func

LongestStreak

func(addr string) int64

LongestStreak returns addr's best streak ever, 0 if it has never checked in.

Open
OID
0c29cf…bc71:11
LongestStreak details

Inspect func

byRank

type

byRank orders the leaderboard by longest streak, then current streak, then owner address — fully deterministic regardless of avl iteration order.

Value

v0.byRank

shortAddr

func(a .uverse.address) string
Open
OID
0c29cf…bc71:12
shortAddr details

Inspect func

renderDetail

func(r *v0.record, height int64) string
Open
OID
0c29cf…bc71:13
renderDetail details

Inspect func

Render

func(path string) string

Render shows either the full leaderboard (path == "") or a single address's detail card when path is a bech32 address.

Open
OID
0c29cf…bc71:14
Render details

Inspect func
graceBlocks : int64 =100
record : type =v0.record
streaks : v0.Tree Inspect
get : func(owner .uverse.address) (*v0.record, bool) Inspect
project : func(r *v0.record, height int64) (current int64, alive bool) Inspect
checkin : func(owner .uverse.address, height int64) string Inspect
CheckIn : func() string Inspect
CurrentStreak : func(addr string) int64 Inspect
LongestStreak : func(addr string) int64 Inspect
byRank : type =v0.byRank
shortAddr : func(a .uverse.address) string Inspect
renderDetail : func(r *v0.record, height int64) string Inspect
Render : func(path string) string Inspect