Search Apps Documentation Source Content File Folder Download Copy Actions Download

z_6_c_filetest.gno

0.66 Kb · 32 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	// Create a new DAO which gives ownership to `test`
22	testing.SetRealm(testing.NewUserRealm(user))
23	testing.SetRealm(testing.NewCodeRealm("gno.land/r/test"))
24	daoID = commondao.New(cross, "Foo").ID()
25}
26
27func main() {
28	commondao.Execute(cross, daoID, 1)
29}
30
31// Error:
32// caller is not a DAO member