z_9_a_filetest.gno
0.60 Kb · 26 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 dstBoard boards.BoardID
13
14func init() {
15 testing.SetRealm(testing.NewUserRealm(address("g1wymu47drhr0kuq2098m792lytgtj2nyx77yrsm"))) // so that CurrentRealm.Addr() matches OrigCaller
16 uinit.RegisterUser(cross, "gnouser123", address("g1wymu47drhr0kuq2098m792lytgtj2nyx77yrsm"))
17
18 dstBoard = boards.CreateBoard(cross, "dst_board")
19}
20
21func main() {
22 boards.CreateRepost(cross, 0, 0, "First Post in (title)", "Body of the first post. (body)", dstBoard)
23}
24
25// Error:
26// invalid non-user call