Render
func(path string) stringRender serves three shapes: /r/moul/vesting/v0 the seeded schedules /r/moul/vesting/v0:g1... one address, its declared schedule /r/moul/vesting/v0:g1...?o=&s=&e=&d= one address, a schedule you supply The query form stores nothing. It exists so an address that has not declared anything can still get a real answer: paste the schedule out of \`gnokey query auth/accounts/\<addr>\` and the balance is still read from chain.
- OID
- 0c3e14…4785:3
Render details
source
typeWhere a schedule came from. This is the distinction the whole page turns on, so it is a value and not a boolean buried in a branch.
Value
v0.source
sourceSeeded
v0.source// a source constant in this realm
Value
<zero>
sourceDeclared
v0.source// written by the address itself
Value
<zero>
sourceQuery
v0.source// typed into the URL by whoever is looking
Value
<zero>
sourceNone
v0.source// there is none
Value
<zero>
header
func() string- OID
- 0c3e14…4785:5
header details
renderIndex
func() string- OID
- 0c3e14…4785:6
renderIndex details
renderAccount
func(addr .uverse.address, s v0.Schedule, src v0.source, label string) string- OID
- 0c3e14…4785:7
renderAccount details
renderUnknown
func(addr .uverse.address) string- OID
- 0c3e14…4785:8
renderUnknown details
sourceNote
func(src v0.source) string- OID
- 0c3e14…4785:9
sourceNote details
lookupForm
func() string- OID
- 0c3e14…4785:10
lookupForm details
scheduleFromQuery
func(req *v0.Request) (v0.Schedule, string)scheduleFromQuery reads a one-off schedule out of the URL. It returns a human-readable reason rather than an error value, because every caller turns it straight into page text.
- OID
- 0c3e14…4785:11
scheduleFromQuery details
orZero
func(s string) string- OID
- 0c3e14…4785:12
orZero details
lockedCapped
func(s v0.Schedule, balance int64, n int64) int64lockedCapped is what the account cannot move, which is never more than it holds. The schedule alone can say otherwise once coins have been spent.
- OID
- 0c3e14…4785:13
lockedCapped details
tstamp
func(sec int64) stringtstamp renders a unix second as a plain UTC date, which is all a two-year term needs. gno has no time formatting worth the dependency here.
- OID
- 0c3e14…4785:14
tstamp details
civil
func(z int64) (year int64, month int64, day int64)civil converts a day count since 1970-01-01 to a calendar date, by Howard Hinnant's civil\_from\_days. Integer only, no time package, no locale.
- OID
- 0c3e14…4785:15
civil details
ufmtDate
func(y int64, m int64, d int64) string- OID
- 0c3e14…4785:16
ufmtDate details
pad2
func(n int64) string- OID
- 0c3e14…4785:17
pad2 details
Path
untyped stringValue
"gno.land/r/moul/vesting/v0"
Link
untyped stringValue
"/r/moul/vesting/v0"
Denom
untyped stringValue
"ugnot"
seeded
[]struct{...}seeded are the schedules this realm ships with, restored by init() after every redeploy. They are source constants and not registry rows on purpose: the realm is private = true, so a redeploy wipes realm state, and the one schedule the page exists to show should not need a transaction to come back. Each is copied from the genesis allocation sheet that built mainnet, which is the public, pinned input named in misc/deployments/mainnet.gno.land/gen-genesis.sh.
- OID
- 0c3e14…4785:19
seeded details
declared
v0.Treedeclared maps an address to the schedule that address declared for itself.
- OID
- 0c3e14…4785:41
declared details
entry
typeentry is one row of the registry.
Value
v0.entry
init.25
func()- OID
- 0c3e14…4785:23
init.25 details
reset
func()reset restores the registry to exactly what the source declares. init() is its only caller on chain; a test calls it to render a page that does not depend on what the test before it wrote, since an Example runs after every Test in the package and sees the state they left.
- OID
- 0c3e14…4785:25
reset details
Declare
func(original int64, start int64, end int64, delayed bool)Declare records the caller's own vesting schedule, replacing any previous one. It cannot write a row for anybody else, which is what keeps the registry honest without the realm being able to verify a thing. Pass original = 0 to declare that the address has no schedule at all.
- OID
- 0c3e14…4785:26
Declare details
Forget
func()Forget removes the caller's own declaration.
- OID
- 0c3e14…4785:27
Forget details
Count
func() intCount returns how many schedules the registry holds.
- OID
- 0c3e14…4785:28
Count details
ScheduleOf
func(addr .uverse.address) (original int64, start int64, end int64, delayed bool, ok bool)ScheduleOf returns the declared schedule for addr, and whether there is one.
- OID
- 0c3e14…4785:29
ScheduleOf details
SpendableOf
func(addr .uverse.address) (spendable int64, ok bool)SpendableOf returns what addr can move right now, and whether the answer rests on a declared schedule. With ok false the figure is the whole balance, which is correct only if the address really has no schedule.
- OID
- 0c3e14…4785:30
SpendableOf details
LockedOf
func(addr .uverse.address) (locked int64, ok bool)LockedOf returns what addr cannot move right now, and whether the answer rests on a declared schedule.
- OID
- 0c3e14…4785:31
LockedOf details
lookup
func(addr .uverse.address) (*v0.entry, bool)lookup reads a row. avl's Get returns ONE value and nil for a miss, unlike Remove which returns two; that asymmetry is a documented gno-vs-Go trap.
- OID
- 0c3e14…4785:32
lookup details
balanceOf
func(addr .uverse.address) int64balanceOf reads the address's TOTAL ugnot, locked included. That is what banker.GetCoins reports and the only balance figure a realm can obtain. A readonly banker takes no realm, so this works from inside Render.
- OID
- 0c3e14…4785:33
balanceOf details
gnot
func(u int64) stringgnot renders a ugnot amount as GNOT with six decimals and no float.
- OID
- 0c3e14…4785:34
gnot details
pad6
func(n int64) stringpad6 left-pads to six digits. ufmt has no width flags, so this is by hand.
- OID
- 0c3e14…4785:35
pad6 details
permille
func(p int64) stringpermille renders tenths of a percent as a percentage with one decimal.
- OID
- 0c3e14…4785:36
permille details
duration
func(sec int64) stringduration renders a span of seconds as days and hours, which is the only resolution worth reading on a two-year schedule.
- OID
- 0c3e14…4785:37
duration details
isAddr
func(s string) boolisAddr is a cheap shape check, so a typo renders as "not an address" rather than as an account with a zero balance.
- OID
- 0c3e14…4785:38
isAddr details
now
func() int64now is the chain's own clock, in unix seconds. time.Now() in a realm returns the BLOCK time, not a wall clock, which is exactly the value the ante handler compares a vesting schedule against.
- OID
- 0c3e14…4785:39
now details
chainHeight
func() int64- OID
- 0c3e14…4785:40