package main // SEND: 1000000ugnot import ( "std" "strconv" "testing" "gno.land/r/demo/boards" users "gno.land/r/gnoland/users/v1" ) var ( bid boards.BoardID pid boards.PostID ) func init() { testing.SetRealm(std.NewUserRealm(std.Address("g1wymu47drhr0kuq2098m792lytgtj2nyx77yrsm"))) // so that CurrentRealm.Addr() matches OrigCaller cross(users.Register)("gnouser123") bid = cross(boards.CreateBoard)("test_board") pid = cross(boards.CreateThread)(bid, "First Post in (title)", "Body of the first post. (body)") } func main() { println(boards.Render("test_board/" + strconv.Itoa(int(pid)))) // post 2 not exist cross(boards.EditPost)(bid, pid, 2, "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