Search Apps Documentation Source Content File Folder Download Copy Actions Download

z_5_d_filetest.gno

0.82 Kb · 40 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 daoID uint64
17
18func init() {
19	// Invite a user to be able to start creating DAOs
20	testing.SetRealm(testing.NewUserRealm(owner))
21	commondao.Invite(cross, user)
22
23	// Create a new DAO which gives ownership to `test`
24	testing.SetRealm(testing.NewUserRealm(user))
25	testing.SetRealm(testing.NewCodeRealm("gno.land/r/test"))
26	dao := commondao.New(cross, "Foo")
27	daoID = dao.ID()
28
29	// Configure DAO
30	dao.Members().Add(user)
31}
32
33func main() {
34	testing.SetRealm(testing.NewUserRealm(user))
35
36	commondao.Vote(cross, daoID, 404, pcommondao.ChoiceYes, "")
37}
38
39// Error:
40// proposal not found