Kind Realm (renderable)
Name v0
Namespace sys / namereg
Exported functions 11
Module gno.land/r/sys/namereg/v0
gno 0.9 z_1_prop2_filetest.gno gno
⧉
1 // PKGPATH: gno.land/r/sys/namereg/v0/filetests/z_1_prop2_filetest 2 3 package z_1_prop2_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 delete user
36 testing.SetOriginCaller(c)
37 testing.SetRealm(testing.NewUserRealm(c))
38 pr := users.ProposeDeleteUser(cross(cur), alice, "delete user test" )
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( "nym-alice123" )
63 if data == nil {
64 println( "Successfully deleted alice" )
65 }
66 }
67
68 // Output:
69 // --
70 // # GovDAO
71 // ## Members
72 // [> Go to Memberstore <](/r/gov/dao/memberstore/v0)
73 // ## Proposals
74 // ### [Prop #0 - User Registry V0: Delete user \`nym\-alice123\`](/r/gov/dao:0)
75 // Author: g1wymu47drhr0kuq2098m792lytgtj2nyx77yrsm
76 //
77 // Status: ACTIVE
78 //
79 // Tiers eligible to vote: T1, T2, T3
80 //
81 // ---
82 //
83 //
84 // --
85 // ## Prop #0 - User Registry V0: Delete user \`nym\-alice123\`
86 // Author: g1wymu47drhr0kuq2098m792lytgtj2nyx77yrsm
87 //
88 // delete user test
89 //
90 // Executor created in: `gno.land/r/sys/namereg/v0`
91 //
92 //
93 //
94 //
95 // ---
96 //
97 // ### Stats
98 // - **Proposal is open for votes**
99 // - Tiers eligible to vote: T1, T2, T3
100 // - YES PERCENT: 0%
101 // - NO PERCENT: 0%
102 // - ABSTAIN PERCENT: 0%
103 //
104 // [Detailed voting list](/r/gov/dao:0/votes)
105 //
106 // ---
107 //
108 // ### Actions
109 // [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)
110 //
111 // WARNING: Please double check transaction data before voting.
112 // --
113 // --
114 // ## Prop #0 - User Registry V0: Delete user \`nym\-alice123\`
115 // Author: g1wymu47drhr0kuq2098m792lytgtj2nyx77yrsm
116 //
117 // delete user test
118 //
119 // Executor created in: `gno.land/r/sys/namereg/v0`
120 //
121 //
122 //
123 //
124 // ---
125 //
126 // ### Stats
127 // - **Proposal is open for votes**
128 // - Tiers eligible to vote: T1, T2, T3
129 // - YES PERCENT: 100%
130 // - NO PERCENT: 0%
131 // - ABSTAIN PERCENT: 0%
132 //
133 // [Detailed voting list](/r/gov/dao:0/votes)
134 //
135 // ---
136 //
137 // ### Actions
138 // [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)
139 //
140 // WARNING: Please double check transaction data before voting.
141 // --
142 // --
143 // ## Prop #0 - User Registry V0: Delete user \`nym\-alice123\`
144 // Author: g1wymu47drhr0kuq2098m792lytgtj2nyx77yrsm
145 //
146 // delete user test
147 //
148 // Executor created in: `gno.land/r/sys/namereg/v0`
149 //
150 //
151 //
152 //
153 // ---
154 //
155 // ### Stats
156 // - **PROPOSAL HAS BEEN ACCEPTED**
157 // - Tiers eligible to vote: T1, T2, T3
158 // - YES PERCENT: 100%
159 // - NO PERCENT: 0%
160 // - ABSTAIN PERCENT: 0%
161 //
162 // [Detailed voting list](/r/gov/dao:0/votes)
163 //
164 // ---
165 //
166 // ### Actions
167 // [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)
168 //
169 // WARNING: Please double check transaction data before voting.
170 // Successfully deleted alice
171
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.