1package main
2
3// SEND: 200000000ugnot
4
5import (
6 "std"
7 "strconv"
8
9 "gno.land/p/demo/testutils"
10 "gno.land/r/demo/boards"
11 "gno.land/r/demo/users"
12)
13
14const admin = std.Address("g1us8428u2a5satrlxzagqqa5m6vmuze025anjlj")
15
16func main() {
17 caller := testutils.TestAddress("caller")
18 std.TestSetRealm(std.NewUserRealm(caller))
19 users.Register("", "gnouser", "my profile")
20 // create board via registered user
21 bid := boards.CreateBoard("test_board")
22 pid := boards.CreateThread(bid, "First Post (title)", "Body of the first post. (body)")
23
24 // create reply via anon user
25 test2 := testutils.TestAddress("test2")
26 std.TestSetOriginCaller(test2)
27 std.TestSetOriginSend(std.Coins{{"ugnot", 9000000}}, nil)
28 boards.CreateReply(bid, pid, pid, "Reply of the first post")
29
30 println(boards.Render("test_board/" + strconv.Itoa(int(pid))))
31}
32
33// Error:
34// please register, otherwise minimum fee 100000000 is required if anonymous
z_5_d_filetest.gno
0.89 Kb ยท 34 lines