Search Apps Documentation Source Content File Folder Download Copy Actions Download

zp_1_d_filetest.gno

0.82 Kb · 39 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	dao.Members().Add(user)
26	dao.Members().Add(owner)
27
28	options := commondao.GetOptions(dao.ID())
29	options.SetAllowTextProposals(true)
30}
31
32func main() {
33	testing.SetRealm(testing.NewUserRealm(user))
34
35	commondao.CreateTextProposal(cross, dao.ID(), "", "", 31)
36}
37
38// Error:
39// maximum proposal voting period is 30 days