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

Community realm. Read the code first. Community realm, deployed by its author. Read the code before you interact or send coins.

probe.gno

0.47 Kb · 24 lines
 1// Package probe measures how long a package waits for approval on Onyx.
 2package probe
 3
 4import "strconv"
 5
 6var (
 7	count int
 8	last  address
 9)
10
11// Bump increments the counter, remembers the caller and returns the new count.
12func Bump(cur realm) int {
13	count++
14	last = cur.Previous().Address()
15	return count
16}
17
18func Render(path string) string {
19	s := "# probe\n\nCounter: " + strconv.Itoa(count) + "\n"
20	if last != "" {
21		s += "\nLast caller: " + last.String() + "\n"
22	}
23	return s
24}