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