Skip to content

Commit

Permalink
fix: fix new refactored code from new merge
Browse files Browse the repository at this point in the history
  • Loading branch information
hthieu1110 committed Feb 12, 2025
1 parent f89408f commit 89d157d
Show file tree
Hide file tree
Showing 36 changed files with 80 additions and 53 deletions.
3 changes: 2 additions & 1 deletion examples/gno.land/r/demo/boards/z_0_a_filetest.gno
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package boards_test

import (
"std"
"testing"

"gno.land/p/demo/testutils"
"gno.land/r/demo/boards"
Expand All @@ -12,7 +13,7 @@ var bid boards.BoardID

func init() {
caller := testutils.TestAddress("caller")
std.TestSetRealm(std.NewUserRealm(caller))
testing.SetRealm(std.NewUserRealm(caller))
bid = boards.CreateBoard("test_board")
boards.CreateThread(bid, "First Post (title)", "Body of the first post. (body)")
pid := boards.CreateThread(bid, "Second Post (title)", "Body of the second post. (body)")
Expand Down
3 changes: 2 additions & 1 deletion examples/gno.land/r/demo/boards/z_0_b_filetest.gno
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ package boards_test

import (
"std"
"testing"

"gno.land/p/demo/testutils"
"gno.land/r/demo/boards"
Expand All @@ -15,7 +16,7 @@ var bid boards.BoardID

func init() {
caller := testutils.TestAddress("caller")
std.TestSetRealm(std.NewUserRealm(caller))
testing.SetRealm(std.NewUserRealm(caller))
users.Register("", "gnouser", "my profile")
bid = boards.CreateBoard("test_board")
}
Expand Down
3 changes: 2 additions & 1 deletion examples/gno.land/r/demo/boards/z_0_c_filetest.gno
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ package boards_test

import (
"std"
"testing"

"gno.land/p/demo/testutils"
"gno.land/r/demo/boards"
Expand All @@ -15,7 +16,7 @@ var bid boards.BoardID

func init() {
caller := testutils.TestAddress("caller")
std.TestSetRealm(std.NewUserRealm(caller))
testing.SetRealm(std.NewUserRealm(caller))
users.Register("", "gnouser", "my profile")
boards.CreateThread(1, "First Post (title)", "Body of the first post. (body)")
}
Expand Down
3 changes: 2 additions & 1 deletion examples/gno.land/r/demo/boards/z_0_d_filetest.gno
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ package boards_test

import (
"std"
"testing"

"gno.land/p/demo/testutils"
"gno.land/r/demo/boards"
Expand All @@ -15,7 +16,7 @@ var bid boards.BoardID

func init() {
caller := testutils.TestAddress("caller")
std.TestSetRealm(std.NewUserRealm(caller))
testing.SetRealm(std.NewUserRealm(caller))
users.Register("", "gnouser", "my profile")
bid = boards.CreateBoard("test_board")
boards.CreateReply(bid, 0, 0, "Reply of the second post")
Expand Down
3 changes: 2 additions & 1 deletion examples/gno.land/r/demo/boards/z_0_e_filetest.gno
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ package boards_test

import (
"std"
"testing"

"gno.land/p/demo/testutils"
"gno.land/r/demo/boards"
Expand All @@ -15,7 +16,7 @@ var bid boards.BoardID

func init() {
caller := testutils.TestAddress("caller")
std.TestSetRealm(std.NewUserRealm(caller))
testing.SetRealm(std.NewUserRealm(caller))
users.Register("", "gnouser", "my profile")
boards.CreateReply(bid, 0, 0, "Reply of the second post")
}
Expand Down
3 changes: 2 additions & 1 deletion examples/gno.land/r/demo/boards/z_0_filetest.gno
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ package boards_test

import (
"std"
"testing"

"gno.land/p/demo/testutils"
"gno.land/r/demo/boards"
Expand All @@ -15,7 +16,7 @@ var bid boards.BoardID

func init() {
caller := testutils.TestAddress("caller")
std.TestSetRealm(std.NewUserRealm(caller))
testing.SetRealm(std.NewUserRealm(caller))
users.Register("", "gnouser", "my profile")

bid = boards.CreateBoard("test_board")
Expand Down
5 changes: 3 additions & 2 deletions examples/gno.land/r/demo/boards/z_10_a_filetest.gno
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ package boards_test
import (
"std"
"strconv"
"testing"

"gno.land/p/demo/testutils"
"gno.land/r/demo/boards"
Expand All @@ -19,7 +20,7 @@ var (

func init() {
caller := testutils.TestAddress("caller")
std.TestSetRealm(std.NewUserRealm(caller))
testing.SetRealm(std.NewUserRealm(caller))
users.Register("", "gnouser", "my profile")

bid = boards.CreateBoard("test_board")
Expand All @@ -28,7 +29,7 @@ func init() {

func main() {
caller := testutils.TestAddress("caller")
std.TestSetRealm(std.NewUserRealm(caller))
testing.SetRealm(std.NewUserRealm(caller))
println(boards.Render("test_board/" + strconv.Itoa(int(pid))))
// boardId 2 not exist
boards.DeletePost(2, pid, pid, "")
Expand Down
5 changes: 3 additions & 2 deletions examples/gno.land/r/demo/boards/z_10_b_filetest.gno
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ package boards_test
import (
"std"
"strconv"
"testing"

"gno.land/p/demo/testutils"
"gno.land/r/demo/boards"
Expand All @@ -19,7 +20,7 @@ var (

func init() {
caller := testutils.TestAddress("caller")
std.TestSetRealm(std.NewUserRealm(caller))
testing.SetRealm(std.NewUserRealm(caller))
users.Register("", "gnouser", "my profile")

bid = boards.CreateBoard("test_board")
Expand All @@ -30,7 +31,7 @@ func main() {
println(boards.Render("test_board/" + strconv.Itoa(int(pid))))
// pid of 2 not exist
caller := testutils.TestAddress("caller")
std.TestSetRealm(std.NewUserRealm(caller))
testing.SetRealm(std.NewUserRealm(caller))
boards.DeletePost(bid, 2, 2, "")
println("----------------------------------------------------")
println(boards.Render("test_board/" + strconv.Itoa(int(pid))))
Expand Down
5 changes: 3 additions & 2 deletions examples/gno.land/r/demo/boards/z_10_c_filetest.gno
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ package boards_test
import (
"std"
"strconv"
"testing"

"gno.land/p/demo/testutils"
"gno.land/r/demo/boards"
Expand All @@ -20,7 +21,7 @@ var (

func init() {
caller := testutils.TestAddress("caller")
std.TestSetRealm(std.NewUserRealm(caller))
testing.SetRealm(std.NewUserRealm(caller))
users.Register("", "gnouser", "my profile")

bid = boards.CreateBoard("test_board")
Expand All @@ -31,7 +32,7 @@ func init() {
func main() {
println(boards.Render("test_board/" + strconv.Itoa(int(pid))))
caller := testutils.TestAddress("caller")
std.TestSetRealm(std.NewUserRealm(caller))
testing.SetRealm(std.NewUserRealm(caller))
boards.DeletePost(bid, pid, rid, "")
println("----------------------------------------------------")
println(boards.Render("test_board/" + strconv.Itoa(int(pid))))
Expand Down
5 changes: 3 additions & 2 deletions examples/gno.land/r/demo/boards/z_10_filetest.gno
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ package boards_test
import (
"std"
"strconv"
"testing"

"gno.land/p/demo/testutils"
"gno.land/r/demo/boards"
Expand All @@ -19,7 +20,7 @@ var (

func init() {
caller := testutils.TestAddress("caller")
std.TestSetRealm(std.NewUserRealm(caller))
testing.SetRealm(std.NewUserRealm(caller))
users.Register("", "gnouser", "my profile")

bid = boards.CreateBoard("test_board")
Expand All @@ -28,7 +29,7 @@ func init() {

func main() {
caller := testutils.TestAddress("caller")
std.TestSetRealm(std.NewUserRealm(caller))
testing.SetRealm(std.NewUserRealm(caller))
println(boards.Render("test_board/" + strconv.Itoa(int(pid))))
boards.DeletePost(bid, pid, pid, "")
println("----------------------------------------------------")
Expand Down
5 changes: 3 additions & 2 deletions examples/gno.land/r/demo/boards/z_11_a_filetest.gno
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ package boards_test
import (
"std"
"strconv"
"testing"

"gno.land/p/demo/testutils"
"gno.land/r/demo/boards"
Expand All @@ -19,7 +20,7 @@ var (

func init() {
caller := testutils.TestAddress("caller")
std.TestSetRealm(std.NewUserRealm(caller))
testing.SetRealm(std.NewUserRealm(caller))
users.Register("", "gnouser", "my profile")

bid = boards.CreateBoard("test_board")
Expand All @@ -30,7 +31,7 @@ func main() {
println(boards.Render("test_board/" + strconv.Itoa(int(pid))))
// board 2 not exist
caller := testutils.TestAddress("caller")
std.TestSetRealm(std.NewUserRealm(caller))
testing.SetRealm(std.NewUserRealm(caller))
boards.EditPost(2, pid, pid, "Edited: First Post in (title)", "Edited: Body of the first post. (body)")
println("----------------------------------------------------")
println(boards.Render("test_board/" + strconv.Itoa(int(pid))))
Expand Down
5 changes: 3 additions & 2 deletions examples/gno.land/r/demo/boards/z_11_b_filetest.gno
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ package boards_test
import (
"std"
"strconv"
"testing"

"gno.land/p/demo/testutils"
"gno.land/r/demo/boards"
Expand All @@ -19,7 +20,7 @@ var (

func init() {
caller := testutils.TestAddress("caller")
std.TestSetRealm(std.NewUserRealm(caller))
testing.SetRealm(std.NewUserRealm(caller))
users.Register("", "gnouser", "my profile")

bid = boards.CreateBoard("test_board")
Expand All @@ -30,7 +31,7 @@ func main() {
println(boards.Render("test_board/" + strconv.Itoa(int(pid))))
// thread 2 not exist
caller := testutils.TestAddress("caller")
std.TestSetRealm(std.NewUserRealm(caller))
testing.SetRealm(std.NewUserRealm(caller))
boards.EditPost(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))))
Expand Down
5 changes: 3 additions & 2 deletions examples/gno.land/r/demo/boards/z_11_c_filetest.gno
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ package boards_test
import (
"std"
"strconv"
"testing"

"gno.land/p/demo/testutils"
"gno.land/r/demo/boards"
Expand All @@ -19,7 +20,7 @@ var (

func init() {
caller := testutils.TestAddress("caller")
std.TestSetRealm(std.NewUserRealm(caller))
testing.SetRealm(std.NewUserRealm(caller))
users.Register("", "gnouser", "my profile")

bid = boards.CreateBoard("test_board")
Expand All @@ -30,7 +31,7 @@ func main() {
println(boards.Render("test_board/" + strconv.Itoa(int(pid))))
// post 2 not exist
caller := testutils.TestAddress("caller")
std.TestSetRealm(std.NewUserRealm(caller))
testing.SetRealm(std.NewUserRealm(caller))
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))))
Expand Down
5 changes: 3 additions & 2 deletions examples/gno.land/r/demo/boards/z_11_d_filetest.gno
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ package boards_test
import (
"std"
"strconv"
"testing"

"gno.land/p/demo/testutils"
"gno.land/r/demo/boards"
Expand All @@ -20,7 +21,7 @@ var (

func init() {
caller := testutils.TestAddress("caller")
std.TestSetRealm(std.NewUserRealm(caller))
testing.SetRealm(std.NewUserRealm(caller))
users.Register("", "gnouser", "my profile")

bid = boards.CreateBoard("test_board")
Expand All @@ -31,7 +32,7 @@ func init() {
func main() {
println(boards.Render("test_board/" + strconv.Itoa(int(pid))))
caller := testutils.TestAddress("caller")
std.TestSetRealm(std.NewUserRealm(caller))
testing.SetRealm(std.NewUserRealm(caller))
boards.EditPost(bid, pid, rid, "", "Edited: First reply of the First post\n")
println("----------------------------------------------------")
println(boards.Render("test_board/" + strconv.Itoa(int(pid))))
Expand Down
5 changes: 3 additions & 2 deletions examples/gno.land/r/demo/boards/z_11_filetest.gno
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ package boards_test
import (
"std"
"strconv"
"testing"

"gno.land/p/demo/testutils"
"gno.land/r/demo/boards"
Expand All @@ -19,7 +20,7 @@ var (

func init() {
caller := testutils.TestAddress("caller")
std.TestSetRealm(std.NewUserRealm(caller))
testing.SetRealm(std.NewUserRealm(caller))
users.Register("", "gnouser", "my profile")

bid = boards.CreateBoard("test_board")
Expand All @@ -29,7 +30,7 @@ func init() {
func main() {
println(boards.Render("test_board/" + strconv.Itoa(int(pid))))
caller := testutils.TestAddress("caller")
std.TestSetRealm(std.NewUserRealm(caller))
testing.SetRealm(std.NewUserRealm(caller))
boards.EditPost(bid, pid, pid, "Edited: First Post in (title)", "Edited: Body of the first post. (body)")
println("----------------------------------------------------")
println(boards.Render("test_board/" + strconv.Itoa(int(pid))))
Expand Down
2 changes: 1 addition & 1 deletion examples/gno.land/r/demo/boards/z_12_a_filetest.gno
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (

func main() {
caller := testutils.TestAddress("caller")
std.TestSetRealm(std.NewUserRealm(caller))
testing.SetRealm(std.NewUserRealm(caller))
users.Register("", "gnouser", "my profile")
// create a post via registered user
bid1 := boards.CreateBoard("test_board1")
Expand Down
2 changes: 1 addition & 1 deletion examples/gno.land/r/demo/boards/z_12_b_filetest.gno
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (

func main() {
caller := testutils.TestAddress("caller")
std.TestSetRealm(std.NewUserRealm(caller))
testing.SetRealm(std.NewUserRealm(caller))
users.Register("", "gnouser", "my profile")
bid1 := boards.CreateBoard("test_board1")
pid := boards.CreateThread(bid1, "First Post (title)", "Body of the first post. (body)")
Expand Down
2 changes: 1 addition & 1 deletion examples/gno.land/r/demo/boards/z_12_c_filetest.gno
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (

func main() {
caller := testutils.TestAddress("caller")
std.TestSetRealm(std.NewUserRealm(caller))
testing.SetRealm(std.NewUserRealm(caller))
users.Register("", "gnouser", "my profile")
bid1 := boards.CreateBoard("test_board1")
boards.CreateThread(bid1, "First Post (title)", "Body of the first post. (body)")
Expand Down
2 changes: 1 addition & 1 deletion examples/gno.land/r/demo/boards/z_12_d_filetest.gno
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (

func main() {
caller := testutils.TestAddress("caller")
std.TestSetRealm(std.NewUserRealm(caller))
testing.SetRealm(std.NewUserRealm(caller))
users.Register("", "gnouser", "my profile")
bid1 := boards.CreateBoard("test_board1")
pid := boards.CreateThread(bid1, "First Post (title)", "Body of the first post. (body)")
Expand Down
5 changes: 3 additions & 2 deletions examples/gno.land/r/demo/boards/z_12_filetest.gno
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ package boards_test

import (
"std"
"testing"

"gno.land/p/demo/testutils"
"gno.land/r/demo/boards"
Expand All @@ -19,7 +20,7 @@ var (

func init() {
caller := testutils.TestAddress("caller")
std.TestSetRealm(std.NewUserRealm(caller))
testing.SetRealm(std.NewUserRealm(caller))
users.Register("", "gnouser", "my profile")

bid1 = boards.CreateBoard("test_board1")
Expand All @@ -29,7 +30,7 @@ func init() {

func main() {
caller := testutils.TestAddress("caller")
std.TestSetRealm(std.NewUserRealm(caller))
testing.SetRealm(std.NewUserRealm(caller))
rid := boards.CreateRepost(bid1, pid, "", "Check this out", bid2)
println(rid)
println(boards.Render("test_board2"))
Expand Down
Loading

0 comments on commit 89d157d

Please sign in to comment.