forked from gnolang/gno
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: support custom VM domain (gnolang#2911)
Introducing the concept of "ChainDomain," a local primary domain for packages. The next step, which will be another PR, is to ensure that we can launch a gnoland/gnodev instance while importing a local folder or using a genesis to preload packages from other domains. This will allow users to add packages only to the primary domain while accessing packages from multiple domains. The result will be a preview of the upcoming IBC era, where a single chain can add packages only to its domain but can fetch missing dependencies from other registered zones. - [x] gnovm unaware of gno.land, just accepting valid domains - [x] vmkeeper initialized with a domain - [x] Stdlib to know the current primary domain + new std.ChainDomain - [x] new unit tests around custom domains Depends on gnolang#2910 Depends on gnolang#3003 Blocks a new PR that will add multidomain support. Related with gnolang#2904 (comment) --------- Signed-off-by: moul <94029+moul@users.noreply.github.com> Co-authored-by: n0izn0iz <n0izn0iz@users.noreply.github.com> Co-authored-by: Mikael VALLENET <mikael.vallenetpro@gmail.com> Co-authored-by: Morgan <morgan@morganbaz.com>
- Loading branch information
1 parent
3429046
commit 82829e4
Showing
26 changed files
with
231 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
gnoland start | ||
|
||
# addpkg with anotherdomain.land | ||
! gnokey maketx addpkg -pkgdir $WORK -pkgpath anotherdomain.land/r/foobar/bar -gas-fee 1000000ugnot -gas-wanted 2000000 -broadcast -chainid=tendermint_test test1 | ||
stdout 'TX HASH:' | ||
stderr 'invalid package path' | ||
stderr 'invalid domain: anotherdomain.land/r/foobar/bar' | ||
|
||
# addpkg with gno.land | ||
gnokey maketx addpkg -pkgdir $WORK -pkgpath gno.land/r/foobar/bar -gas-fee 1000000ugnot -gas-wanted 2000000 -broadcast -chainid=tendermint_test test1 | ||
stdout 'OK!' | ||
|
||
-- bar.gno -- | ||
package bar | ||
func Render(path string) string { return "hello" } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,28 @@ | ||
# test for https://github.com/gnolang/gno/pull/3003 | ||
# Test for #3003, #2911. | ||
|
||
gnoland start | ||
|
||
# Query and validate official parameters. | ||
# These parameters should ideally be tested in a txtar format to ensure that a | ||
# default initialization of "gnoland" provides the expected default values. | ||
|
||
# Verify the default chain domain parameter for Gno.land | ||
gnokey query params/vm/gno.land/r/sys/params.vm.chain_domain.string | ||
stdout 'data: "gno.land"$' | ||
|
||
# Test custom parameters to confirm they return the expected values and types. | ||
|
||
gnokey query params/vm/gno.land/r/sys/params.test.foo.string | ||
stdout 'data: "bar"$' | ||
|
||
gnokey query params/vm/gno.land/r/sys/params.test.foo.int64 | ||
stdout 'data: "-1337"' | ||
|
||
gnokey query params/vm/gno.land/r/sys/params.test.foo.uint64 | ||
stdout 'data: "42"' | ||
|
||
gnokey query params/vm/gno.land/r/sys/params.test.foo.bool | ||
stdout 'data: true' | ||
# XXX: bytes | ||
|
||
# TODO: Consider adding a test case for a byte array parameter | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.