Search Apps Documentation Source Content File Folder Download Copy Actions Download

z_9_b_filetest.gno

0.73 Kb · 30 lines
 1package main
 2
 3// SEND: 1000000ugnot
 4
 5import (
 6	"testing"
 7
 8	"gno.land/r/archive/boards"
 9	uinit "gno.land/r/sys/users/init"
10)
11
12var (
13	srcBoard boards.BoardID
14	pid      boards.PostID
15)
16
17func init() {
18	testing.SetRealm(testing.NewUserRealm(address("g1wymu47drhr0kuq2098m792lytgtj2nyx77yrsm"))) // so that CurrentRealm.Addr() matches OrigCaller
19	uinit.RegisterUser(cross, "gnouser123", address("g1wymu47drhr0kuq2098m792lytgtj2nyx77yrsm"))
20
21	srcBoard = boards.CreateBoard(cross, "first_board")
22	pid = boards.CreateThread(cross, srcBoard, "First Post in (title)", "Body of the first post. (body)")
23}
24
25func main() {
26	boards.CreateRepost(cross, srcBoard, pid, "First Post in (title)", "Body of the first post. (body)", 0)
27}
28
29// Error:
30// invalid non-user call