z_7_c_filetest.gno
0.79 Kb · 37 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 parentID 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
22 testing.SetRealm(testing.NewUserRealm(user))
23
24 // Create the root DAO
25 testing.SetRealm(testing.NewCodeRealm("gno.land/r/test"))
26 parentID = commondao.New(cross, "Parent DAO").ID()
27}
28
29func main() {
30 testing.SetRealm(testing.NewUserRealm(user))
31 testing.SetRealm(testing.NewCodeRealm("gno.land/r/test"))
32
33 commondao.NewSubDAO(cross, "", parentID)
34}
35
36// Error:
37// DAO name is empty