Search Apps Documentation Source Content File Folder Download Copy Actions Download

zp_2_h_filetest.gno

0.89 Kb · 43 lines
 1package main
 2
 3import (
 4	"strings"
 5	"testing"
 6
 7	"gno.land/r/nt/commondao/v0"
 8)
 9
10const (
11	owner = address("g16jpf0puufcpcjkph5nxueec8etpcldz7zwgydq") // @devx
12	user  = address("g1jg8mtutu9khhfwc4nxmuhcpftf0pajdhfvsqf5") // @test1
13)
14
15var (
16	daoID uint64
17	name  = strings.Repeat("A", 61)
18)
19
20func init() {
21	testing.SetRealm(testing.NewUserRealm(owner))
22	commondao.Invite(cross, user)
23
24	testing.SetRealm(testing.NewUserRealm(user))
25	testing.SetRealm(testing.NewCodeRealm("gno.land/r/demo/test"))
26	dao := commondao.New(cross, "Foo")
27	dao.Members().Add(user)
28
29	options := commondao.GetOptions(dao.ID())
30	options.SetAllowChildren(true)
31	options.SetAllowSubDAOPorposals(true)
32
33	daoID = dao.ID()
34}
35
36func main() {
37	testing.SetRealm(testing.NewUserRealm(user))
38
39	commondao.CreateSubDAOProposal(cross, daoID, name, "g1jg8mtutu9khhfwc4nxmuhcpftf0pajdhfvsqf5")
40}
41
42// Error:
43// DAO name is too long, max length is 60 characters