1// PKGPATH: gno.land/r/gnops/valopers/proposal/filetests/z_governed_instructions_filetest2//3// Positive counterpart to4// r/gnops/valopers/filetests/z_foreign_realm_capability_filetest.gno.5//6// Sealing the privileged closure inside a dao.ProposalRequest closes the7// capability leak, but it would be worthless if it8// also broke the legitimate path. This runs the real thing end to end —9// propose, vote, execute — and asserts the instructions are actually10// rewritten.11//12// Read the two files together: same write, but reachable ONLY with a13// GovDAO majority behind it.14package z_governed_instructions_filetest1516import (17 "chain/runtime/unsafe"18 "strings"19 "testing"2021 "gno.land/r/gnops/valopers"22 "gno.land/r/gnops/valopers/proposal"23 "gno.land/r/gov/dao"24 daov3init "gno.land/r/gov/dao/init/v0"25)2627var member address = unsafe.OriginCaller()2829func init(cur realm) {30 daov3init.InitWithUsers(cross(cur), member)3132 testing.SetOriginCaller(member)33 testing.SetRealm(testing.NewUserRealm(member))3435 pr := proposal.ProposeNewInstructionsProposalRequest(cross(cur), "GOVERNED-INSTRUCTIONS")36 dao.MustCreateProposal(cross(cur), pr)37}3839func main(cur realm) {40 testing.SetOriginCaller(member)4142 println("before:", strings.Contains(valopers.Render(""), "GOVERNED-INSTRUCTIONS"))4344 // Voter-facing disclosure (the pr6068 anti-phishing line, rendered as45 // "Executor created in: ..."). It moved from r/gnops/valopers/proposal46 // to r/gnops/valopers when request construction moved into the realm,47 // so pin it rather than let it drift unobserved.48 prop, err := dao.GetProposal(dao.ProposalID(0))49 if err != nil {50 panic(err)51 }52 println("title:", prop.Title())53 println("executor created in:", prop.ExecutorCreationRealm())5455 dao.MustVoteOnProposal(cross(cur), dao.NewVoteRequest(dao.YesVote, dao.ProposalID(0)))56 println("executed:", dao.ExecuteProposal(cross(cur), dao.ProposalID(0)))5758 println("after:", strings.Contains(valopers.Render(""), "GOVERNED-INSTRUCTIONS"))59}6061// Output:62// before: false63// title: /r/gnops/valopers: Update instructions64// executor created in: gno.land/r/gnops/valopers65// executed: true66// after: true67NewValidatorProposalRequest(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) struct{title string; description string; executor gno.land/r/gov/dao.Executor; filter gno.land/r/gov/dao.Filter}
ProposeAuthorityRotationProposalRequest(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}, newContractPath string) struct{title string; description string; executor gno.land/r/gov/dao.Executor; filter gno.land/r/gov/dao.Filter}
ProposeNewInstructionsProposalRequest(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}, newInstructions string) struct{title string; description string; executor gno.land/r/gov/dao.Executor; filter gno.land/r/gov/dao.Filter}
ProposeNewMinFeeProposalRequest(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}, newMinFee int64) struct{title string; description string; executor gno.land/r/gov/dao.Executor; filter gno.land/r/gov/dao.Filter}
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.