Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: replace old realm path to current one #681

Merged
merged 4 commits into from
Jun 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/gno.land/p/demo/groups/z_1_filetest.gno
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// PKGPATH: gno.land/r/groups_test
// PKGPATH: gno.land/r/demo/groups_test
package groups_test

import (
Expand Down
4 changes: 2 additions & 2 deletions examples/gno.land/r/demo/art/millipede/millipede.gno
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ func Render(path string) string {

output := "```\n" + Draw(size) + "```\n"
if size > minSize {
output += ufmt.Sprintf("[%d](/r/art/millpede:%d)< ", size-1, size-1)
output += ufmt.Sprintf("[%d](/r/demo/art/millpede:%d)< ", size-1, size-1)
}
if size < maxSize {
output += ufmt.Sprintf(" >[%d](/r/art/millipede:%d)", size+1, size+1)
output += ufmt.Sprintf(" >[%d](/r/demo/art/millipede:%d)", size+1, size+1)
}
return output
}
Expand Down
5 changes: 2 additions & 3 deletions examples/gno.land/r/demo/art/millipede/millipede_test.gno
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package millipede

import (
"fmt"
"testing"
)

Expand Down Expand Up @@ -34,7 +33,7 @@ func TestRender(t *testing.T) {
╚═(███)═╝
╚═(███)═╝
╚═(███)═╝
` + "```\n[19](/r/art/millpede:19)< >[21](/r/art/millipede:21)",
` + "```\n[19](/r/demo/art/millpede:19)< >[21](/r/demo/art/millipede:21)",
},
{
path: "4",
Expand All @@ -44,7 +43,7 @@ func TestRender(t *testing.T) {
╚═(███)═╝
╚═(███)═╝
╚═(███)═╝
` + "```\n[3](/r/art/millpede:3)< >[5](/r/art/millipede:5)",
` + "```\n[3](/r/demo/art/millpede:3)< >[5](/r/demo/art/millipede:5)",
},
}

Expand Down
27 changes: 8 additions & 19 deletions examples/gno.land/r/demo/banktest/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
This is a simple test realm contract that demonstrates how to use the banker.

See [gno.land/r/banktest/banktest.go](/r/banktest/banktest.go) to see the original contract code.
See [gno.land/r/demo/banktest/banktest.go](/r/demo/banktest/banktest.go) to see the original contract code.

This article will go through each line to explain how it works.

Expand All @@ -16,8 +16,7 @@ import (
)
```

The "std" package is defined by the gno code in stdlibs/std/. </br>
Self explanatory; and you'll see more usage from std later.
The "std" package is defined by the gno code in stdlibs/std/. </br> Self explanatory; and you'll see more usage from std later.

```go
type activity struct {
Expand All @@ -37,14 +36,9 @@ func (act *activity) String() string {
var latest [10]*activity
```

This is just maintaining a list of recent activity to this contract.
Notice that the "latest" variable is defined "globally" within
the context of the realm with path "gno.land/r/banktest".
This is just maintaining a list of recent activity to this contract. Notice that the "latest" variable is defined "globally" within the context of the realm with path "gno.land/r/demo/banktest".

This means that calls to functions defined within this package
are encapsulated within this "data realm", where the data is
mutated based on transactions that can potentially cross many
realm and non-realm package boundaries (in the call stack).
This means that calls to functions defined within this package are encapsulated within this "data realm", where the data is mutated based on transactions that can potentially cross many realm and non-realm package boundaries (in the call stack).

```go
// Deposit will take the coins (to the realm's pkgaddr) or return them to user.
Expand All @@ -54,11 +48,7 @@ func Deposit(returnDenom string, returnAmount int64) string {
send := std.Coins{{returnDenom, returnAmount}}
```

This is the beginning of the definition of the contract function named
"Deposit". `std.AssertOriginCall() asserts that this function was called by a
gno transactional Message. The caller is the user who signed off on this
transactional message. Send is the amount of deposit sent along with this
message.
This is the beginning of the definition of the contract function named "Deposit". `std.AssertOriginCall() asserts that this function was called by a gno transactional Message. The caller is the user who signed off on this transactional message. Send is the amount of deposit sent along with this message.

```go
// record activity
Expand All @@ -74,7 +64,7 @@ message.
latest[0] = act
```

Updating the "latest" array for viewing at gno.land/r/banktest: (w/ trailing colon).
Updating the "latest" array for viewing at gno.land/r/demo/banktest: (w/ trailing colon).

```go
// return if any.
Expand All @@ -98,8 +88,7 @@ use a std.Banker instance to return any deposited coins to the original sender.

Notice that each realm package has an associated Cosmos address.


Finally, the results are rendered via an ABCI query call when you visit [/r/banktest:](/r/banktest:).
Finally, the results are rendered via an ABCI query call when you visit [/r/demo/banktest:](/r/demo/banktest:).

```go
func Render(path string) string {
Expand All @@ -124,4 +113,4 @@ func Render(path string) string {
}
```

You can call this contract yourself, by vistiing [/r/banktest](/r/banktest) and the [quickstart guide](/r/boards:gnolang/4).
You can call this contract yourself, by vistiing [/r/demo/banktest](/r/demo/banktest) and the [quickstart guide](/r/demo/boards:gnolang/4).
2 changes: 1 addition & 1 deletion examples/gno.land/r/demo/boards/z_0_a_filetest.gno
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// PKGPATH: gno.land/r/boards_test
// PKGPATH: gno.land/r/demo/boards_test
package boards_test

import (
Expand Down
2 changes: 1 addition & 1 deletion examples/gno.land/r/demo/boards/z_0_b_filetest.gno
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// PKGPATH: gno.land/r/boards_test
// PKGPATH: gno.land/r/demo/boards_test
package boards_test

// SEND: 199000000ugnot
Expand Down
2 changes: 1 addition & 1 deletion examples/gno.land/r/demo/boards/z_0_c_filetest.gno
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// PKGPATH: gno.land/r/boards_test
// PKGPATH: gno.land/r/demo/boards_test
package boards_test

// SEND: 200000000ugnot
Expand Down
2 changes: 1 addition & 1 deletion examples/gno.land/r/demo/boards/z_0_d_filetest.gno
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// PKGPATH: gno.land/r/boards_test
// PKGPATH: gno.land/r/demo/boards_test
package boards_test

// SEND: 200000000ugnot
Expand Down
2 changes: 1 addition & 1 deletion examples/gno.land/r/demo/boards/z_0_e_filetest.gno
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// PKGPATH: gno.land/r/boards_test
// PKGPATH: gno.land/r/demo/boards_test
package boards_test

// SEND: 200000000ugnot
Expand Down
2 changes: 1 addition & 1 deletion examples/gno.land/r/demo/boards/z_0_filetest.gno
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// PKGPATH: gno.land/r/boards_test
// PKGPATH: gno.land/r/demo/boards_test
package boards_test

// SEND: 200000000ugnot
Expand Down
2 changes: 1 addition & 1 deletion examples/gno.land/r/demo/boards/z_10_a_filetest.gno
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// PKGPATH: gno.land/r/boards_test
// PKGPATH: gno.land/r/demo/boards_test
package boards_test

// SEND: 200000000ugnot
Expand Down
2 changes: 1 addition & 1 deletion examples/gno.land/r/demo/boards/z_10_b_filetest.gno
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// PKGPATH: gno.land/r/boards_test
// PKGPATH: gno.land/r/demo/boards_test
package boards_test

// SEND: 2000000000ugnot
Expand Down
2 changes: 1 addition & 1 deletion examples/gno.land/r/demo/boards/z_10_c_filetest.gno
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// PKGPATH: gno.land/r/boards_test
// PKGPATH: gno.land/r/demo/boards_test
package boards_test

// SEND: 200000000ugnot
Expand Down
2 changes: 1 addition & 1 deletion examples/gno.land/r/demo/boards/z_10_filetest.gno
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// PKGPATH: gno.land/r/boards_test
// PKGPATH: gno.land/r/demo/boards_test
package boards_test

// SEND: 200000000ugnot
Expand Down
2 changes: 1 addition & 1 deletion examples/gno.land/r/demo/boards/z_11_a_filetest.gno
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// PKGPATH: gno.land/r/boards_test
// PKGPATH: gno.land/r/demo/boards_test
package boards_test

// SEND: 2000000000ugnot
Expand Down
2 changes: 1 addition & 1 deletion examples/gno.land/r/demo/boards/z_11_b_filetest.gno
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// PKGPATH: gno.land/r/boards_test
// PKGPATH: gno.land/r/demo/boards_test
package boards_test

// SEND: 2000000000ugnot
Expand Down
2 changes: 1 addition & 1 deletion examples/gno.land/r/demo/boards/z_11_c_filetest.gno
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// PKGPATH: gno.land/r/boards_test
// PKGPATH: gno.land/r/demo/boards_test
package boards_test

// SEND: 2000000000ugnot
Expand Down
2 changes: 1 addition & 1 deletion examples/gno.land/r/demo/boards/z_11_d_filetest.gno
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// PKGPATH: gno.land/r/boards_test
// PKGPATH: gno.land/r/demo/boards_test
package boards_test

// SEND: 2000000000ugnot
Expand Down
2 changes: 1 addition & 1 deletion examples/gno.land/r/demo/boards/z_11_filetest.gno
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// PKGPATH: gno.land/r/boards_test
// PKGPATH: gno.land/r/demo/boards_test
package boards_test

// SEND: 2000000000ugnot
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
@@ -1,4 +1,4 @@
// PKGPATH: gno.land/r/boards_test
// PKGPATH: gno.land/r/demo/boards_test
package boards_test

// SEND: 200000000ugnot
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
@@ -1,4 +1,4 @@
// PKGPATH: gno.land/r/boards_test
// PKGPATH: gno.land/r/demo/boards_test
package boards_test

// SEND: 200000000ugnot
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
@@ -1,4 +1,4 @@
// PKGPATH: gno.land/r/boards_test
// PKGPATH: gno.land/r/demo/boards_test
package boards_test

// SEND: 200000000ugnot
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
@@ -1,4 +1,4 @@
// PKGPATH: gno.land/r/boards_test
// PKGPATH: gno.land/r/demo/boards_test
package boards_test

// SEND: 200000000ugnot
Expand Down
2 changes: 1 addition & 1 deletion examples/gno.land/r/demo/boards/z_12_filetest.gno
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// PKGPATH: gno.land/r/boards_test
// PKGPATH: gno.land/r/demo/boards_test
package boards_test

// SEND: 200000000ugnot
Expand Down
2 changes: 1 addition & 1 deletion examples/gno.land/r/demo/boards/z_1_filetest.gno
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// PKGPATH: gno.land/r/boards_test
// PKGPATH: gno.land/r/demo/boards_test
package boards_test

// SEND: 200000000ugnot
Expand Down
2 changes: 1 addition & 1 deletion examples/gno.land/r/demo/boards/z_2_filetest.gno
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// PKGPATH: gno.land/r/boards_test
// PKGPATH: gno.land/r/demo/boards_test
package boards_test

// SEND: 200000000ugnot
Expand Down
2 changes: 1 addition & 1 deletion examples/gno.land/r/demo/boards/z_3_filetest.gno
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// PKGPATH: gno.land/r/boards_test
// PKGPATH: gno.land/r/demo/boards_test
package boards_test

// SEND: 200000000ugnot
Expand Down
4 changes: 2 additions & 2 deletions examples/gno.land/r/demo/boards/z_4_filetest.gno
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// PKGPATH: gno.land/r/boards_test
// PKGPATH: gno.land/r/demo/boards_test
package boards_test

// SEND: 200000000ugnot
Expand Down Expand Up @@ -962,4 +962,4 @@ func main() {
// switchrealm["gno.land/r/demo/users"]
// switchrealm["gno.land/r/demo/users"]
// switchrealm["gno.land/r/demo/boards"]
// switchrealm["gno.land/r/boards_test"]
// switchrealm["gno.land/r/demo/boards_test"]
2 changes: 1 addition & 1 deletion examples/gno.land/r/demo/boards/z_5_filetest.gno
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// PKGPATH: gno.land/r/boards_test
// PKGPATH: gno.land/r/demo/boards_test
package boards_test

// SEND: 200000000ugnot
Expand Down
2 changes: 1 addition & 1 deletion examples/gno.land/r/demo/boards/z_6_filetest.gno
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// PKGPATH: gno.land/r/boards_test
// PKGPATH: gno.land/r/demo/boards_test
package boards_test

// SEND: 200000000ugnot
Expand Down
2 changes: 1 addition & 1 deletion examples/gno.land/r/demo/boards/z_7_filetest.gno
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// PKGPATH: gno.land/r/boards_test
// PKGPATH: gno.land/r/demo/boards_test
package boards_test

// SEND: 2000000000ugnot
Expand Down
2 changes: 1 addition & 1 deletion examples/gno.land/r/demo/boards/z_8_filetest.gno
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// PKGPATH: gno.land/r/boards_test
// PKGPATH: gno.land/r/demo/boards_test
package boards_test

// SEND: 2000000000ugnot
Expand Down
4 changes: 1 addition & 3 deletions examples/gno.land/r/demo/boards/z_9_a_filetest.gno
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
// PKGPATH: gno.land/r/boards_test
// PKGPATH: gno.land/r/demo/boards_test
package boards_test

// SEND: 200000000ugnot

import (
"strconv"

"gno.land/r/demo/boards"
"gno.land/r/demo/users"
)
Expand Down
4 changes: 1 addition & 3 deletions examples/gno.land/r/demo/boards/z_9_b_filetest.gno
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
// PKGPATH: gno.land/r/boards_test
// PKGPATH: gno.land/r/demo/boards_test
package boards_test

// SEND: 200000000ugnot

import (
"strconv"

"gno.land/r/demo/boards"
"gno.land/r/demo/users"
)
Expand Down
2 changes: 1 addition & 1 deletion examples/gno.land/r/demo/boards/z_9_filetest.gno
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// PKGPATH: gno.land/r/boards_test
// PKGPATH: gno.land/r/demo/boards_test
package boards_test

// SEND: 200000000ugnot
Expand Down
4 changes: 2 additions & 2 deletions examples/gno.land/r/demo/groups/misc.gno
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,9 @@ func summaryOf(str string, length int) string {
func displayAddressMD(addr std.Address) string {
user := users.GetUserByAddress(addr)
if user == nil {
return "[" + addr.String() + "](/r/users:" + addr.String() + ")"
return "[" + addr.String() + "](/r/demo/users:" + addr.String() + ")"
}
return "[@" + user.Name + "](/r/users:" + user.Name + ")"
return "[@" + user.Name + "](/r/demo/users:" + user.Name + ")"
}

func usernameOf(addr std.Address) string {
Expand Down
2 changes: 1 addition & 1 deletion examples/gno.land/r/demo/groups/render.gno
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ func Render(path string) string {
}
parts := strings.Split(path, "/")
if len(parts) == 1 {
// /r/Groups:Group_NAME
// /r/demo/groups:Group_NAME
name := parts[0]
groupI, exists := gGroupsByName.Get(name)
if !exists {
Expand Down
2 changes: 1 addition & 1 deletion examples/gno.land/r/demo/groups/z_0_a_filetest.gno
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// PKGPATH: gno.land/r/groups_test
// PKGPATH: gno.land/r/demo/groups_test
package groups_test

import (
Expand Down
2 changes: 1 addition & 1 deletion examples/gno.land/r/demo/groups/z_0_b_filetest.gno
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// PKGPATH: gno.land/r/groups_test
// PKGPATH: gno.land/r/demo/groups_test
package groups_test

import (
Expand Down
2 changes: 1 addition & 1 deletion examples/gno.land/r/demo/groups/z_0_c_filetest.gno
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// PKGPATH: gno.land/r/groups_test
// PKGPATH: gno.land/r/demo/groups_test
package groups_test

// SEND: 200000000ugnot
Expand Down
3 changes: 1 addition & 2 deletions examples/gno.land/r/demo/groups/z_1_a_filetest.gno
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
// PKGPATH: gno.land/r/groups_test
// PKGPATH: gno.land/r/demo/groups_test
package groups_test

// SEND: 200000000ugnot

import (
"std"
"strconv"

"gno.land/p/demo/testutils"
"gno.land/r/demo/groups"
Expand Down
2 changes: 1 addition & 1 deletion examples/gno.land/r/demo/groups/z_1_b_filetest.gno
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// PKGPATH: gno.land/r/groups_test
// PKGPATH: gno.land/r/demo/groups_test
package groups_test

// SEND: 200000000ugnot
Expand Down
4 changes: 1 addition & 3 deletions examples/gno.land/r/demo/groups/z_1_c_filetest.gno
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
// PKGPATH: gno.land/r/groups_test
// PKGPATH: gno.land/r/demo/groups_test
package groups_test

// SEND: 200000000ugnot

import (
"std"
"strconv"

"gno.land/p/demo/testutils"
"gno.land/r/demo/groups"
"gno.land/r/demo/users"
)

var gid groups.GroupID
Expand Down
Loading
Loading