Search Apps Documentation Source Content File Folder Download Copy Actions Download

zp_0_e_filetest.gno

0.96 Kb · 43 lines
 1package main
 2
 3import (
 4	"testing"
 5
 6	"gno.land/r/nt/commondao/v0"
 7)
 8
 9const (
10	owner = address("g16jpf0puufcpcjkph5nxueec8etpcldz7zwgydq") // @devx
11	user  = address("g1jg8mtutu9khhfwc4nxmuhcpftf0pajdhfvsqf5") // @test1
12)
13
14var daoID uint64
15
16func init() {
17	// Invite a user to be able to start creating DAOs
18	testing.SetRealm(testing.NewUserRealm(owner))
19	commondao.Invite(cross, user)
20
21	// The origin must be the invited user where invitation
22	// is removed after the first user call to create a DAO
23	testing.SetRealm(testing.NewUserRealm(user))
24
25	// Create root DAO with a subDAO
26	testing.SetRealm(testing.NewCodeRealm("gno.land/r/demo/test"))
27	dao := commondao.New(cross, "Foo")
28	dao.Members().Add(user)
29
30	daoID = dao.ID()
31
32	options := commondao.GetOptions(daoID)
33	options.SetAllowMembersUpdate(true)
34}
35
36func main() {
37	testing.SetRealm(testing.NewUserRealm(user))
38
39	commondao.CreateMembersUpdateProposal(cross, daoID, "not-an-address", "")
40}
41
42// Error:
43// invalid address: not-an-address