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

render_example_test.gno

1.25 Kb · 37 lines
 1package usernames
 2
 3// ExampleRender pins the tool's landing page.
 4//
 5// The landing page only, deliberately: a result page reads r/sys/users, whose
 6// state is whatever the tests in this package left behind, and an example runs
 7// after all of them. The results are asserted in render_test.gno instead.
 8func ExampleRender() {
 9	print(Render(""))
10	// Output:
11	// [toolbox](/r/moul/toolbox) / **Usernames**
12	//
13	// # Usernames
14	//
15	// Who holds a name, and what name an address holds. Type either one.
16	//
17	// <gno-form path="lookup">
18	// <gno-input name="q" type="text" placeholder="username or g1 address" />
19	// </gno-form>
20	//
21	// ## What this answers
22	//
23	// - The address behind a username, and the username behind an address.
24	// - Whether the name you typed is their **current** name or one they renamed away from.
25	// - The canonical key the name collapses to, and who already holds that key.
26	//
27	// ## The same thing from a terminal
28	//
29	// This page is `r/sys/users` read through `vm/qeval`, with the follow-up questions already asked:
30	//
31	// ```sh
32	// gnokey query vm/qeval -remote https://rpc.gno.land \
33	//   -data 'gno.land/r/moul/toolbox/usernames.Resolve("moul")'
34	// ```
35	//
36	// Try [moul](/r/moul/toolbox/usernames:moul), or paste an address into the box above.
37}