-
Notifications
You must be signed in to change notification settings - Fork 385
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: add regression integ test for gnoverse/gnochess#97 (#1608)
From #1172, pushed to current codebase. Co-authored-by: Manfred Touron <[email protected]>
- Loading branch information
Showing
1 changed file
with
41 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# test for https://github.com/gnolang/gnochess/issues/97 | ||
|
||
gnoland start | ||
|
||
gnokey maketx addpkg -pkgdir $WORK -pkgpath gno.land/r/demo/bug97 -gas-fee 1000000ugnot -gas-wanted 2000000 -broadcast -chainid=tendermint_test test1 | ||
|
||
gnokey maketx call -pkgpath 'gno.land/r/demo/bug97' -func 'RealmCall1' -gas-fee 1000000ugnot -gas-wanted 2000000 -send '' -broadcast -chainid='tendermint_test' test1 | ||
stdout 'OK!' | ||
|
||
gnokey maketx call -pkgpath 'gno.land/r/demo/bug97' -func 'RealmCall2' -gas-fee 1000000ugnot -gas-wanted 2000000 -send '' -broadcast -chainid='tendermint_test' test1 | ||
stdout 'OK!' | ||
|
||
gnokey maketx call -pkgpath 'gno.land/r/demo/bug97' -func 'RealmCall1' -gas-fee 1000000ugnot -gas-wanted 2000000 -send '' -broadcast -chainid='tendermint_test' test1 | ||
stdout 'OK!' | ||
|
||
-- bug97.gno -- | ||
package bug97 | ||
|
||
var x = [3]int{1, 2, 3} | ||
|
||
func newX() [3]int { return x} | ||
|
||
type S struct { | ||
Arr [3]int | ||
} | ||
|
||
func NewS() S { | ||
return S{Arr: x} | ||
} | ||
|
||
var s S | ||
|
||
func RealmCall1() { | ||
s = NewS() | ||
} | ||
|
||
func RealmCall2() { | ||
arr2 := s.Arr | ||
arr2[0] = 8 | ||
s = S{Arr: arr2} | ||
} |