Search Apps Documentation Source Content File Folder Download Copy Actions Download

z_6_a_filetest.gno

0.65 Kb · 31 lines
 1// Test getting flags from an unflagged thread
 2package main
 3
 4import (
 5	"testing"
 6
 7	"gno.land/p/gnoland/boards"
 8
 9	boards2 "gno.land/r/gnoland/boards2/v1"
10	"gno.land/r/gnoland/boards2/v1/hub"
11)
12
13var (
14	boardID  boards.ID
15	threadID boards.ID
16)
17
18func init() {
19	testing.SetRealm(testing.NewUserRealm("g1rp7cmetn27eqlpjpc4vuusf8kaj746tysc0qgh"))
20	boardID = boards2.CreateBoard(cross, "test123", false, false)
21	threadID = boards2.CreateThread(cross, boardID, "Title", "Body")
22}
23
24func main() {
25	testing.SetRealm(testing.NewCodeRealm("gno.land/r/gnoland/boards2/test"))
26	flags := hub.GetFlags(uint64(boardID), uint64(threadID), 0, 0, 1)
27	println(len(flags))
28}
29
30// Output:
31// 0