Skip to content

Commit

Permalink
fix: use txlink package's Call fucntion instead of URL
Browse files Browse the repository at this point in the history
  • Loading branch information
jeronimoalbi committed Dec 18, 2024
1 parent 64be845 commit eff7e0b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion examples/gno.land/r/demo/boards2/board.gno
Original file line number Diff line number Diff line change
Expand Up @@ -114,5 +114,5 @@ func (board *Board) GetURLFromReplyID(threadID, replyID PostID) string {
}

func (board *Board) GetPostFormURL() string {
return txlink.URL("CreateThread", "bid", board.id.String())
return txlink.Call("CreateThread", "bid", board.id.String())
}
2 changes: 1 addition & 1 deletion examples/gno.land/r/demo/boards2/board_test.gno
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ func TestBoard_GetURLFromReplyID(t *testing.T) {
func TestBoard_GetPostFormURL(t *testing.T) {
bid := BoardID(386)
b := newBoard(bid, "foo1234", "")
expect := txlink.URL("CreateThread", "bid", bid.String())
expect := txlink.Call("CreateThread", "bid", bid.String())
got := b.GetPostFormURL()
uassert.Equal(t, expect, got)
}
8 changes: 4 additions & 4 deletions examples/gno.land/r/demo/boards2/post.gno
Original file line number Diff line number Diff line change
Expand Up @@ -180,28 +180,28 @@ func (post *Post) GetURL() string {
}

func (post *Post) GetReplyFormURL() string {
return txlink.URL("CreateReply",
return txlink.Call("CreateReply",
"bid", post.board.id.String(),
"threadID", post.threadID.String(),
"postID", post.id.String(),
)
}

func (post *Post) GetRepostFormURL() string {
return txlink.URL("CreateRepost",
return txlink.Call("CreateRepost",
"bid", post.board.id.String(),
"postID", post.id.String(),
)
}

func (post *Post) GetDeleteFormURL() string {
if post.IsThread() {
return txlink.URL("DeleteThread",
return txlink.Call("DeleteThread",
"bid", post.board.id.String(),
"threadID", post.threadID.String(),
)
}
return txlink.URL("DeleteReply",
return txlink.Call("DeleteReply",
"bid", post.board.id.String(),
"threadID", post.threadID.String(),
"replyID", post.id.String(),
Expand Down

0 comments on commit eff7e0b

Please sign in to comment.