Kind Realm (renderable)
Name v0
Namespace sys / namereg
Exported functions 11
Module gno.land/r/sys/namereg/v0
gno 0.9 z_0_prop1_filetest.gno gno
⧉
1 // PKGPATH: gno.land/r/sys/namereg/v0/filetests/z_0_prop1_filetest 2 3 package z_0_prop1_filetest 4 5 import ( 6 "chain" 7 "chain/runtime/unsafe" 8 Canonicalize (s string) string
IsPaused () bool
IsReserved (stem string) bool
NewSetPausedExecutor (cur interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string}, newPausedValue bool) struct{title string; description string; executor gno.land/r/gov/dao.Executor; filter gno.land/r/gov/dao.Filter}
ProposeDeleteUser (cur interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string}, addr string, reason string) struct{title string; description string; executor gno.land/r/gov/dao.Executor; filter gno.land/r/gov/dao.Filter}
ProposeNewName (cur interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string}, addr string, newName string) struct{title string; description string; executor gno.land/r/gov/dao.Executor; filter gno.land/r/gov/dao.Filter}
ProposeNewRegisterPrice (cur interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string}, newPrice int64) struct{title string; description string; executor gno.land/r/gov/dao.Executor; filter gno.land/r/gov/dao.Filter}
Register (cur interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string}, username string)
Render (path string) string
RenderLatestUsersWidget (num int) string
ValidateNymFormat (username string) interface {Error func() string}
Signatures reconstructed verbatim from vm/qfuncs — interface params keep their inline definitions.
"testing"
9
10 "gno.land/p/nt/testutils/v0"
11 "gno.land/r/gov/dao"
12 daov3init "gno.land/r/gov/dao/init/v0"
13 users "gno.land/r/sys/namereg/v0"
14 susers "gno.land/r/sys/users"
15 )
16
17 // Test updating a name via GovDAO
18 var c address = unsafe.OriginCaller()
19
20 func init(cur realm) {
21 // Whitelist this realm as a controller so its Register() can reach r/sys/users.
22 testing.SetHeight( 0 )
23 susers.AddControllerAtGenesis(cross(cur), chain.PackageAddress( "gno.land/r/sys/namereg/v0" ))
24 testing.SetHeight( 123 )
25
26 daov3init.InitWithUsers(cross(cur), c)
27
28 alice := testutils.TestAddress( "alice" )
29
30 // Register alice
31 testing.SetOriginCaller(alice)
32 testing.SetRealm(testing.NewUserRealm(alice))
33 users.Register(cross(cur), "nym-alice123" )
34
35 // Prop to change name
36 testing.SetOriginCaller(c)
37 testing.SetRealm(testing.NewUserRealm(c))
38 pr := users.ProposeNewName(cross(cur), alice, "alice_new123" )
39 dao.MustCreateProposal(cross(cur), pr)
40 }
41
42 func main(cur realm) {
43 testing.SetOriginCaller(c)
44
45 println( "--" )
46 println(dao.Render(cross(cur), "" ))
47 println( "--" )
48 println(dao.Render(cross(cur), "0" ))
49 println( "--" )
50
51 dao.MustVoteOnProposal(cross(cur), dao.NewVoteRequest(dao.YesVote, dao.ProposalID( 0 )))
52
53 println( "--" )
54 println(dao.Render(cross(cur), "0" ))
55 println( "--" )
56
57 dao.ExecuteProposal(cross(cur), dao.ProposalID( 0 ))
58
59 println( "--" )
60 println(dao.Render(cross(cur), "0" ))
61
62 data, _ := susers.ResolveName( "alice_new123" )
63 println(data.Addr())
64 }
65
66 // Output:
67 // --
68 // # GovDAO
69 // ## Members
70 // [> Go to Memberstore <](/r/gov/dao/memberstore/v0)
71 // ## Proposals
72 // ### [Prop #0 - User Registry V0: Rename user \`nym\-alice123\` to \`alice\_new123\`](/r/gov/dao:0)
73 // Author: g1wymu47drhr0kuq2098m792lytgtj2nyx77yrsm
74 //
75 // Status: ACTIVE
76 //
77 // Tiers eligible to vote: T1, T2, T3
78 //
79 // ---
80 //
81 //
82 // --
83 // ## Prop #0 - User Registry V0: Rename user \`nym\-alice123\` to \`alice\_new123\`
84 // Author: g1wymu47drhr0kuq2098m792lytgtj2nyx77yrsm
85 //
86 //
87 //
88 // Executor created in: `gno.land/r/sys/namereg/v0`
89 //
90 //
91 //
92 //
93 // ---
94 //
95 // ### Stats
96 // - **Proposal is open for votes**
97 // - Tiers eligible to vote: T1, T2, T3
98 // - YES PERCENT: 0%
99 // - NO PERCENT: 0%
100 // - ABSTAIN PERCENT: 0%
101 //
102 // [Detailed voting list](/r/gov/dao:0/votes)
103 //
104 // ---
105 //
106 // ### Actions
107 // [Vote YES](/r/gov/dao$help&func=MustVoteOnProposalSimple&option=YES&pid=0) | [Vote NO](/r/gov/dao$help&func=MustVoteOnProposalSimple&option=NO&pid=0) | [Vote ABSTAIN](/r/gov/dao$help&func=MustVoteOnProposalSimple&option=ABSTAIN&pid=0)
108 //
109 // WARNING: Please double check transaction data before voting.
110 // --
111 // --
112 // ## Prop #0 - User Registry V0: Rename user \`nym\-alice123\` to \`alice\_new123\`
113 // Author: g1wymu47drhr0kuq2098m792lytgtj2nyx77yrsm
114 //
115 //
116 //
117 // Executor created in: `gno.land/r/sys/namereg/v0`
118 //
119 //
120 //
121 //
122 // ---
123 //
124 // ### Stats
125 // - **Proposal is open for votes**
126 // - Tiers eligible to vote: T1, T2, T3
127 // - YES PERCENT: 100%
128 // - NO PERCENT: 0%
129 // - ABSTAIN PERCENT: 0%
130 //
131 // [Detailed voting list](/r/gov/dao:0/votes)
132 //
133 // ---
134 //
135 // ### Actions
136 // [Vote YES](/r/gov/dao$help&func=MustVoteOnProposalSimple&option=YES&pid=0) | [Vote NO](/r/gov/dao$help&func=MustVoteOnProposalSimple&option=NO&pid=0) | [Vote ABSTAIN](/r/gov/dao$help&func=MustVoteOnProposalSimple&option=ABSTAIN&pid=0)
137 //
138 // WARNING: Please double check transaction data before voting.
139 // --
140 // --
141 // ## Prop #0 - User Registry V0: Rename user \`nym\-alice123\` to \`alice\_new123\`
142 // Author: g1wymu47drhr0kuq2098m792lytgtj2nyx77yrsm
143 //
144 //
145 //
146 // Executor created in: `gno.land/r/sys/namereg/v0`
147 //
148 //
149 //
150 //
151 // ---
152 //
153 // ### Stats
154 // - **PROPOSAL HAS BEEN ACCEPTED**
155 // - Tiers eligible to vote: T1, T2, T3
156 // - YES PERCENT: 100%
157 // - NO PERCENT: 0%
158 // - ABSTAIN PERCENT: 0%
159 //
160 // [Detailed voting list](/r/gov/dao:0/votes)
161 //
162 // ---
163 //
164 // ### Actions
165 // [Vote YES](/r/gov/dao$help&func=MustVoteOnProposalSimple&option=YES&pid=0) | [Vote NO](/r/gov/dao$help&func=MustVoteOnProposalSimple&option=NO&pid=0) | [Vote ABSTAIN](/r/gov/dao$help&func=MustVoteOnProposalSimple&option=ABSTAIN&pid=0)
166 //
167 // WARNING: Please double check transaction data before voting.
168 // g1v9kxjcm9ta047h6lta047h6lta047h6lzd40gh
169
vm/qrender output, sanitized (docs/render-security.md) and displayed in an empty-sandbox iframe — scripts, forms and popups cannot run. Links stay inert in-preview; right-click to open.