package main // SEND: 1000000ugnot import ( "strconv" "testing" "gno.land/r/archive/boards" uinit "gno.land/r/sys/users/init" ) var ( bid boards.BoardID pid boards.PostID ) func init() { testing.SetRealm(testing.NewUserRealm(address("g1wymu47drhr0kuq2098m792lytgtj2nyx77yrsm"))) // so that CurrentRealm.Addr() matches OrigCaller uinit.RegisterUser(cross, "gnouser123", address("g1wymu47drhr0kuq2098m792lytgtj2nyx77yrsm")) bid = boards.CreateBoard(cross, "test_board") pid = boards.CreateThread(cross, bid, "First Post in (title)", "Body of the first post. (body)") } func main() { println(boards.Render("test_board/" + strconv.Itoa(int(pid)))) // thread 2 not exist boards.EditPost(cross, bid, 2, pid, "Edited: First Post in (title)", "Edited: Body of the first post. (body)") println("----------------------------------------------------") println(boards.Render("test_board/" + strconv.Itoa(int(pid)))) } // Error: // invalid non-user call