Search Apps Documentation Source Content File Folder Download Copy Actions Download

z_5_f_filetest.gno

0.73 Kb · 33 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/nt/commondao/v0"))
24	dao := commondao.New(cross, "Foo", commondao.AllowVoting(false)) // Disallow voting
25	daoID = dao.ID()
26}
27
28func main() {
29	commondao.Vote(cross, daoID, 0, "", "")
30}
31
32// Error:
33// voting is not enabled