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

validator_scores state

Back to all declarations

admin

.uverse.address

Value

<gnolang.StringValue>

publisher

.uverse.address

Value

<gnolang.StringValue>

isCanonicalAddress

func(s string) bool

isCanonicalAddress accepts only a lowercase, checksummed g1 address.

Open
OID
0f2c7f…b7e1:7
isCanonicalAddress details

Inspect func

SetPublisher

func(addr .uverse.address)

SetPublisher replaces the publisher. Admin only.

Open
OID
0f2c7f…b7e1:8
SetPublisher details

Inspect func

GetAdmin

func() string

GetAdmin returns the admin address, for post-deployment checks.

Open
OID
0f2c7f…b7e1:9
GetAdmin details

Inspect func

GetPublisher

func() string

GetPublisher returns the current publisher address.

Open
OID
0f2c7f…b7e1:10
GetPublisher details

Inspect func

edition

type

An edition keeps each candidate as its validated payload line, in the order added. One string per candidate costs about 160 bytes of storage deposit; a struct in an AVL tree cost about 3,700 bytes (measured on gnodev at the gnoland-1 runtime).

Value

validator_scores.edition

editions

[]*validator_scores.edition (len=1)

editions holds the sealed editions in order, then at most one open edition, always last.

Open
OID
0f2c7f…b7e1:46
editions details (len=1)

+1 more Inspect slice

operatorLen

untyped bigint

operatorLen is the length of a canonical g1 address, the prefix of a line.

Value

(40 <untyped> bigint)

openEdition

func() *validator_scores.edition
Open
OID
0f2c7f…b7e1:12
openEdition details

Inspect func

requireOpen

func(number int) *validator_scores.edition
Open
OID
0f2c7f…b7e1:14
requireOpen details

Inspect func

OpenEdition

func(computedAt string, scorecardSHA256 string, arenas string) int

OpenEdition starts a new edition and returns its number. Publisher only. arenas is a comma-separated list, for example "challenge,test13,firedrill".

Open
OID
0f2c7f…b7e1:15
OpenEdition details

Inspect func

AddCandidates

func(number int, payload string)

AddCandidates adds one candidate per payload line to the open edition. Publisher only. The whole payload is validated before anything is stored.

Open
OID
0f2c7f…b7e1:16
AddCandidates details

Inspect func

Seal

func(number int, expectedCount int)

Seal closes the open edition for good. Publisher only. It fails unless the edition holds exactly expectedCount candidates (at least one).

Open
OID
0f2c7f…b7e1:17
Seal details

Inspect func

DiscardOpen

func()

DiscardOpen drops the open edition. Publisher only. Its number is reused by the next OpenEdition. The slot is cleared first so the backing array does not keep the discarded edition stored.

Open
OID
0f2c7f…b7e1:18
DiscardOpen details

Inspect func

hexDigits

untyped string

Value

"0123456789abcdef"

quoteSafe

func(s string) string

quoteSafe quotes a string the realm validated to need no JSON escaping (addresses, dates, hashes, arena names). Concatenation is cheap in gas; per-byte loops are not.

Open
OID
0f2c7f…b7e1:19
quoteSafe details

Inspect func

quoteMoniker

func(s string) string

quoteMoniker quotes a validated moniker (valid UTF-8, no control characters): only '"' and '\\' need escaping.

Open
OID
0f2c7f…b7e1:21
quoteMoniker details

Inspect func

writeJSONString

func(b *strings.Builder, s string)

writeJSONString writes any string as a JSON string. Invalid UTF-8 bytes become U+FFFD. It costs gas per rune: use it only for short or unvalidated input.

Open
OID
0f2c7f…b7e1:22
writeJSONString details

Inspect func

writeStrings

func(b *strings.Builder, list []string)
Open
OID
0f2c7f…b7e1:23
writeStrings details

Inspect func

candidate

type

candidate is a stored line split into its fields. Numbers stay in their canonical decimal text, which is valid JSON.

Value

validator_scores.candidate

decode

func(line string) validator_scores.candidate
Open
OID
0f2c7f…b7e1:24
decode details

Inspect func

byRank

type

Value

validator_scores.byRank

sortedCandidates

func(e *validator_scores.edition) []validator_scores.candidate

sortedCandidates lists an edition's candidates by rank, then moniker (byte order), then operator.

Open
OID
0f2c7f…b7e1:25
sortedCandidates details

Inspect func

latestSealed

func() *validator_scores.edition
Open
OID
0f2c7f…b7e1:26
latestSealed details

Inspect func

scoreFields

func(c validator_scores.candidate) string

scoreFields is \`"moniker":M,"total":T,"rank":R,"github":G\`, shared by both JSON shapes.

Open
OID
0f2c7f…b7e1:27
scoreFields details

Inspect func

editionJSON

func(e *validator_scores.edition) string
Open
OID
0f2c7f…b7e1:28
editionJSON details

Inspect func

LatestJSON

func() string

LatestJSON returns the latest sealed edition, or "null".

Open
OID
0f2c7f…b7e1:29
LatestJSON details

Inspect func

EditionJSON

func(n int) string

EditionJSON returns sealed edition n, or "null".

Open
OID
0f2c7f…b7e1:30
EditionJSON details

Inspect func

CandidateJSON

func(operator string) string

CandidateJSON returns the operator's entries across sealed editions, in edition order; "entries" is \[] for an unknown address.

Open
OID
0f2c7f…b7e1:31
CandidateJSON details

Inspect func

OpenEditionJSON

func() string

OpenEditionJSON returns the open edition (number, scorecard hash and the operators already added, in the order added), or "null".

Open
OID
0f2c7f…b7e1:32
OpenEditionJSON details

Inspect func

initialPublisher

.uverse.address

Value

<gnolang.StringValue>

formatHundredths

func(s string) string

formatHundredths renders the canonical decimal "8743" as "87.43".

Open
OID
0f2c7f…b7e1:33
formatHundredths details

Inspect func

mdEscape

func(s string) string

mdEscape backslash-escapes every ASCII punctuation character, so a moniker renders as plain text and never as an author-chosen link, image or HTML. gnoweb still turns a g1 address that follows a space into a link to its /u/ page, with the address itself as the link text.

Open
OID
0f2c7f…b7e1:35
mdEscape details

Inspect func

Render

func(string) string

Render shows the latest sealed edition as a Markdown table. The path is ignored.

Open
OID
0f2c7f…b7e1:36
Render details

Inspect func

maxMonikerBytes

untyped bigint

Value

(64 <untyped> bigint)

maxArenas

untyped bigint

Value

(16 <untyped> bigint)

maxArenaName

untyped bigint

Value

(32 <untyped> bigint)

maxScore

untyped bigint

// 100.00 in hundredths: total and each arena score

Value

(10000 <untyped> bigint)

maxGithub

untyped bigint

// 10.00 in hundredths: the GitHub bonus

Value

(1000 <untyped> bigint)

maxRank

untyped bigint

Value

(100000 <untyped> bigint)

isComputedAt

func(s string) bool

isComputedAt accepts a UTC date ("2026-10-13") or a UTC RFC 3339 time without fraction ("2026-10-13T09:00:00Z").

Open
OID
0f2c7f…b7e1:37
isComputedAt details

Inspect func

isSHA256Hex

func(s string) bool
Open
OID
0f2c7f…b7e1:39
isSHA256Hex details

Inspect func

parseArenas

func(s string) []string

parseArenas splits a comma-separated list of 1 to 16 distinct names made of \[a-z0-9\_-], each 1 to 32 bytes.

Open
OID
0f2c7f…b7e1:40
parseArenas details

Inspect func

isMoniker

func(s string) bool

isMoniker rejects empty or oversized monikers, invalid UTF-8, ASCII and C1 control characters (U+0000-U+001F, U+007F, U+0080-U+009F), bidirectional control characters (U+202A-U+202E, U+2066-U+2069), surrounding spaces, and the separator and contact characters '|' and '@'. Zero-width and directional marks (U+200B-U+200F) stay allowed: emoji monikers use U+200D.

Open
OID
0f2c7f…b7e1:41
isMoniker details

Inspect func

parseNat

func(s string, max int) (int, bool)

parseNat parses a canonical non-negative decimal (no sign, no leading zero) not above max.

Open
OID
0f2c7f…b7e1:42
parseNat details

Inspect func

lineError

func(n int, msg string) string
Open
OID
0f2c7f…b7e1:43
lineError details

Inspect func

checkLine

func(line string, arenaCount int, n int) string

checkLine validates "operator|moniker|total|rank|github|s1,...,sN" and returns the operator. Every number must be canonical, so a stored line can be copied into JSON as is.

Open
OID
0f2c7f…b7e1:44
checkLine details

Inspect func
admin : .uverse.address =<gnolang.StringValue>
publisher : .uverse.address =<gnolang.StringValue>
caller : func() .uverse.address Inspect
requirePublisher : func() Inspect
isCanonicalAddress : func(s string) bool Inspect
SetPublisher : func(addr .uverse.address) Inspect
GetAdmin : func() string Inspect
GetPublisher : func() string Inspect
edition : type =validator_scores.edition
editions : []*validator_scores.edition (len=1) Inspect
operatorLen : untyped bigint =(40 <untyped> bigint)
openEdition : func() *validator_scores.edition Inspect
requireOpen : func(number int) *validator_scores.edition Inspect
OpenEdition : func(computedAt string, scorecardSHA256 string, arenas string) int Inspect
AddCandidates : func(number int, payload string) Inspect
Seal : func(number int, expectedCount int) Inspect
DiscardOpen : func() Inspect
hexDigits : untyped string ="0123456789abcdef"
quoteSafe : func(s string) string Inspect
quoteMoniker : func(s string) string Inspect
writeJSONString : func(b *strings.Builder, s string) Inspect
writeStrings : func(b *strings.Builder, list []string) Inspect
candidate : type =validator_scores.candidate
decode : func(line string) validator_scores.candidate Inspect
byRank : type =validator_scores.byRank
sortedCandidates : func(e *validator_scores.edition) []validator_scores.candidate Inspect
latestSealed : func() *validator_scores.edition Inspect
scoreFields : func(c validator_scores.candidate) string Inspect
editionJSON : func(e *validator_scores.edition) string Inspect
LatestJSON : func() string Inspect
EditionJSON : func(n int) string Inspect
CandidateJSON : func(operator string) string Inspect
OpenEditionJSON : func() string Inspect
initialPublisher : .uverse.address =<gnolang.StringValue>
formatHundredths : func(s string) string Inspect
mdEscape : func(s string) string Inspect
Render : func(string) string Inspect
maxMonikerBytes : untyped bigint =(64 <untyped> bigint)
maxArenas : untyped bigint =(16 <untyped> bigint)
maxArenaName : untyped bigint =(32 <untyped> bigint)
maxScore : untyped bigint =(10000 <untyped> bigint)
maxGithub : untyped bigint =(1000 <untyped> bigint)
maxRank : untyped bigint =(100000 <untyped> bigint)
isComputedAt : func(s string) bool Inspect
isSHA256Hex : func(s string) bool Inspect
parseArenas : func(s string) []string Inspect
isMoniker : func(s string) bool Inspect
parseNat : func(s string, max int) (int, bool) Inspect
lineError : func(n int, msg string) string Inspect
checkLine : func(line string, arenaCount int, n int) string Inspect