1// PKGPATH: gno.land/r/sys/namereg/v0/filetests/z_2_prop3_filetest23package z_2_prop3_filetest45import (6 "chain"7 "chain/runtime/unsafe"8 "testing"910 "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)1617// Test the full governance-driven registerPrice flow:18// 1. propose a new price via users.ProposeNewRegisterPrice19// 2. DAO accepts the proposal (vote YES, execute)20// 3. verify the executed callback updated registerPrice by exercising21// Register with the new amount and watching it succeed (registration22// under the old default of 0 ugnot would now panic with the new23// price in the error message).24var c address = unsafe.OriginCaller()2526func init(cur realm) {27 // Whitelist this realm as a controller so its Register() can reach r/sys/users.28 testing.SetHeight(0)29 susers.AddControllerAtGenesis(cross(cur), chain.PackageAddress("gno.land/r/sys/namereg/v0"))30 testing.SetHeight(123)3132 daov3init.InitWithUsers(cross(cur), c)3334 // Propose raising the price from 0 to 20 GNOT.35 testing.SetOriginCaller(c)36 testing.SetRealm(testing.NewUserRealm(c))37 pr := users.ProposeNewRegisterPrice(cross(cur), 20_000_000)38 dao.MustCreateProposal(cross(cur), pr)39}4041func main(cur realm) {42 testing.SetOriginCaller(c)4344 // Vote and execute.45 dao.MustVoteOnProposal(cross(cur), dao.NewVoteRequest(dao.YesVote, dao.ProposalID(0)))46 dao.ExecuteProposal(cross(cur), dao.ProposalID(0))4748 // New price should be active. Register a user with the new amount;49 // registration with the old default (0 ugnot) would panic.50 alice := testutils.TestAddress("alice")51 testing.SetOriginCaller(alice)52 testing.SetRealm(testing.NewUserRealm(alice))53 testing.SetOriginSend(chain.Coins{{Denom: "ugnot", Amount: 20_000_000}})54 users.Register(cross(cur), "nym-alice123")5556 data, _ := susers.ResolveName("nym-alice123")57 println("registered alice at:", data.Addr())58}5960// Output:61// registered alice at: g1v9kxjcm9ta047h6lta047h6lta047h6lzd40gh62Canonicalize(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.
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.