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

test: add regression integ test for gnolang/gnochess#97 #1608

Merged
merged 1 commit into from
Feb 1, 2024
Merged
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
41 changes: 41 additions & 0 deletions gno.land/cmd/gnoland/testdata/issue-gnochess-97.txtar
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}
}
Loading