Search Apps Documentation Source Content File Folder Download Copy Actions Download

zp_1_e_filetest.gno

0.76 Kb · 37 lines
 1package main
 2
 3import (
 4	"testing"
 5
 6	pcommondao "gno.land/p/nt/commondao/v0"
 7
 8	"gno.land/r/nt/commondao/v0"
 9)
10
11const (
12	owner = address("g16jpf0puufcpcjkph5nxueec8etpcldz7zwgydq") // @devx
13	user  = address("g1jg8mtutu9khhfwc4nxmuhcpftf0pajdhfvsqf5") // @test1
14)
15
16var dao *pcommondao.CommonDAO
17
18func init() {
19	testing.SetRealm(testing.NewUserRealm(owner))
20	commondao.Invite(cross, user)
21
22	testing.SetRealm(testing.NewUserRealm(user))
23	testing.SetRealm(testing.NewCodeRealm("gno.land/r/demo/test"))
24	dao = commondao.New(cross, "Foo")
25
26	options := commondao.GetOptions(dao.ID())
27	options.SetAllowTextProposals(true)
28}
29
30func main() {
31	testing.SetRealm(testing.NewUserRealm(user))
32
33	commondao.CreateTextProposal(cross, dao.ID(), "", "", 1)
34}
35
36// Error:
37// caller is not a DAO member