Skip to content

Commit

Permalink
Update txtars
Browse files Browse the repository at this point in the history
  • Loading branch information
zivkovicmilos committed Jan 9, 2025
1 parent 400e32d commit 4958b1c
Show file tree
Hide file tree
Showing 6 changed files with 646 additions and 32 deletions.
23 changes: 12 additions & 11 deletions gno.land/pkg/integration/testdata/event_multi_msg.txtar
Original file line number Diff line number Diff line change
@@ -1,29 +1,30 @@
# load the package from $WORK directory
loadpkg gno.land/r/demo/simple_event $WORK/event

# add a random user
adduserfrom user1 'success myself purchase tray reject demise scene little legend someone lunar hope media goat regular test area smart save flee surround attack rapid smoke'
stdout 'g1c0j899h88nwyvnzvh5jagpq6fkkyuj76nld6t0'

# start a new node
gnoland start

## test1 account should be available on default
gnokey query auth/accounts/${USER_ADDR_test1}
## account should be available since it has an initial balance
gnokey query auth/accounts/g1c0j899h88nwyvnzvh5jagpq6fkkyuj76nld6t0
stdout 'height: 0'
stdout 'data: {'
stdout ' "BaseAccount": {'
stdout ' "address": "g1jg8mtutu9khhfwc4nxmuhcpftf0pajdhfvsqf5",'
stdout ' "address": "g1c0j899h88nwyvnzvh5jagpq6fkkyuj76nld6t0",'
stdout ' "coins": "[0-9]*ugnot",' # dynamic
stdout ' "public_key": {'
stdout ' "@type": "/tm.PubKeySecp256k1",'
stdout ' "value": "A\+FhNtsXHjLfSJk1lB8FbiL4mGPjc50Kt81J7EKDnJ2y"'
stdout ' },'
stdout ' "account_number": "0",'
stdout ' "sequence": "1"'
stdout ' "public_key": null,'
stdout ' "account_number": "57",'
stdout ' "sequence": "0"'
stdout ' }'
stdout '}'
! stderr '.+' # empty


## sign
gnokey sign -tx-path $WORK/multi/multi_msg.tx -chainid=tendermint_test -account-number 0 -account-sequence 1 test1
gnokey sign -tx-path $WORK/multi/multi_msg.tx -chainid=tendermint_test -account-number 57 -account-sequence 0 user1
stdout 'Tx successfully signed and saved to '

## broadcast
Expand All @@ -49,5 +50,5 @@ func Event(value string) {
}

-- multi/multi_msg.tx --
{"msg":[{"@type":"/vm.m_call","caller":"g1jg8mtutu9khhfwc4nxmuhcpftf0pajdhfvsqf5","send":"","pkg_path":"gno.land/r/demo/simple_event","func":"Event","args":["value11"]},{"@type":"/vm.m_call","caller":"g1jg8mtutu9khhfwc4nxmuhcpftf0pajdhfvsqf5","send":"","pkg_path":"gno.land/r/demo/simple_event","func":"Event","args":["value22"]}],"fee":{"gas_wanted":"2000000","gas_fee":"1000000ugnot"},"signatures":null,"memo":""}
{"msg":[{"@type":"/vm.m_call","caller":"g1c0j899h88nwyvnzvh5jagpq6fkkyuj76nld6t0","send":"","pkg_path":"gno.land/r/demo/simple_event","func":"Event","args":["value11"]},{"@type":"/vm.m_call","caller":"g1c0j899h88nwyvnzvh5jagpq6fkkyuj76nld6t0","send":"","pkg_path":"gno.land/r/demo/simple_event","func":"Event","args":["value22"]}],"fee":{"gas_wanted":"2000000","gas_fee":"1000000ugnot"},"signatures":null,"memo":""}

10 changes: 7 additions & 3 deletions gno.land/pkg/integration/testdata/gnokey.txtar
Original file line number Diff line number Diff line change
@@ -1,18 +1,22 @@
# test basic gnokey integrations commands
# golden files have been generated using UPDATE_SCRIPTS=true

# add a random user
adduserfrom user1 'alpha ability feed thrive color fee grace message chief helmet laundry inmate index brave luxury toddler spawn vague index able zone shoe collect escape'
stdout 'g16v6rp3f4vehjspcu0g0xwz9xvehdkac9kslk5m'

# start gnoland
gnoland start

## test1 account should be available on default
gnokey query auth/accounts/${USER_ADDR_test1}
gnokey query auth/accounts/g16v6rp3f4vehjspcu0g0xwz9xvehdkac9kslk5m
stdout 'height: 0'
stdout 'data: {'
stdout ' "BaseAccount": {'
stdout ' "address": "g1jg8mtutu9khhfwc4nxmuhcpftf0pajdhfvsqf5",'
stdout ' "address": "g16v6rp3f4vehjspcu0g0xwz9xvehdkac9kslk5m",'
stdout ' "coins": "[0-9]*ugnot",' # dynamic
stdout ' "public_key": null,'
stdout ' "account_number": "0",'
stdout ' "account_number": "57",'
stdout ' "sequence": "0"'
stdout ' }'
stdout '}'
Expand Down
21 changes: 11 additions & 10 deletions gno.land/pkg/integration/testdata/gnoweb_airgapped.txtar
Original file line number Diff line number Diff line change
Expand Up @@ -4,32 +4,33 @@
# load the package from $WORK directory
loadpkg gno.land/r/demo/echo

# add a random user
adduserfrom user1 'lamp any denial pulse used shoot gap error denial mansion hurry foot solution grab winner congress drastic cat bamboo chicken color digital coffee unknown'
stdout 'g1meuazsmy8ztaz2xpuyraqq4axy6s00ycl07zva'

# start the node
gnoland start

# Query account
gnokey query auth/accounts/${USER_ADDR_test1}
gnokey query auth/accounts/g1meuazsmy8ztaz2xpuyraqq4axy6s00ycl07zva
stdout 'height: 0'
stdout 'data: {'
stdout ' "BaseAccount": {'
stdout ' "address": "g1jg8mtutu9khhfwc4nxmuhcpftf0pajdhfvsqf5",'
stdout ' "address": "g1meuazsmy8ztaz2xpuyraqq4axy6s00ycl07zva",'
stdout ' "coins": "[0-9]*ugnot",' # dynamic
stdout ' "public_key": {'
stdout ' "@type": "/tm.PubKeySecp256k1",'
stdout ' "value": "A\+FhNtsXHjLfSJk1lB8FbiL4mGPjc50Kt81J7EKDnJ2y"'
stdout ' },'
stdout ' "account_number": "0",'
stdout ' "sequence": "4"'
stdout ' "public_key": null,'
stdout ' "account_number": "57",'
stdout ' "sequence": "0"'
stdout ' }'
stdout '}'
! stderr '.+' # empty

# Create transaction
gnokey maketx call -pkgpath "gno.land/r/demo/echo" -func "Render" -gas-fee 1000000ugnot -gas-wanted 2000000 -send "" -args "HELLO" test1
gnokey maketx call -pkgpath "gno.land/r/demo/echo" -func "Render" -gas-fee 1000000ugnot -gas-wanted 2000000 -send "" -args "HELLO" user1
cp stdout call.tx

# Sign
gnokey sign -tx-path $WORK/call.tx -chainid "tendermint_test" -account-number 0 -account-sequence 4 test1
gnokey sign -tx-path $WORK/call.tx -chainid "tendermint_test" -account-number 57 -account-sequence 0 user1
cmpenv stdout sign.stdout.golden

gnokey broadcast $WORK/call.tx
Expand Down
16 changes: 10 additions & 6 deletions gno.land/pkg/integration/testdata/restart_missing_type.txtar
Original file line number Diff line number Diff line change
@@ -1,19 +1,23 @@
# add a random user
adduserfrom user1 'bone make joy hospital hawk crew civil relief maple alter always frozen category emerge fun inflict room sphere casino vital scheme basket omit wrap'
stdout 'g1lmgyf29g6zqgpln5pq05zzt7qkz2wga7xgagv4'

# This txtar is a regression test for a bug, whereby a type is committed to
# the defaultStore.cacheTypes map, but not to the underlying store (due to a
# failing transaction).
# For more information: https://github.com/gnolang/gno/pull/2605
loadpkg gno.land/p/demo/avl
gnoland start

gnokey sign -tx-path $WORK/tx1.tx -chainid tendermint_test -account-sequence 1 test1
gnokey sign -tx-path $WORK/tx1.tx -chainid tendermint_test -account-sequence 0 -account-number 57 user1
! gnokey broadcast $WORK/tx1.tx
stderr 'out of gas'

gnokey sign -tx-path $WORK/tx2.tx -chainid tendermint_test -account-sequence 2 test1
gnokey sign -tx-path $WORK/tx2.tx -chainid tendermint_test -account-sequence 1 -account-number 57 user1
gnokey broadcast $WORK/tx2.tx
stdout 'OK!'

gnokey sign -tx-path $WORK/tx3.tx -chainid tendermint_test -account-sequence 3 test1
gnokey sign -tx-path $WORK/tx3.tx -chainid tendermint_test -account-sequence 2 -account-number 57 user1
gnokey broadcast $WORK/tx3.tx
stdout 'OK!'

Expand All @@ -24,7 +28,7 @@ gnoland restart
"msg": [
{
"@type": "/vm.m_addpkg",
"creator": "g1jg8mtutu9khhfwc4nxmuhcpftf0pajdhfvsqf5",
"creator": "g1lmgyf29g6zqgpln5pq05zzt7qkz2wga7xgagv4",
"package": {
"name": "zentasktic",
"path": "gno.land/p/g17ernafy6ctpcz6uepfsq2js8x2vz0wladh5yc3/zentasktic",
Expand Down Expand Up @@ -99,7 +103,7 @@ gnoland restart
"msg": [
{
"@type": "/vm.m_addpkg",
"creator": "g1jg8mtutu9khhfwc4nxmuhcpftf0pajdhfvsqf5",
"creator": "g1lmgyf29g6zqgpln5pq05zzt7qkz2wga7xgagv4",
"package": {
"name": "zentasktic",
"path": "gno.land/p/g17ernafy6ctpcz6uepfsq2js8x2vz0wladh5yc3/zentasktic",
Expand Down Expand Up @@ -174,7 +178,7 @@ gnoland restart
"msg": [
{
"@type": "/vm.m_addpkg",
"creator": "g1jg8mtutu9khhfwc4nxmuhcpftf0pajdhfvsqf5",
"creator": "g1lmgyf29g6zqgpln5pq05zzt7qkz2wga7xgagv4",
"package": {
"name": "zentasktic_core",
"path": "gno.land/r/g17ernafy6ctpcz6uepfsq2js8x2vz0wladh5yc3/zentasktic_core",
Expand Down
4 changes: 2 additions & 2 deletions gno.land/pkg/integration/testdata/simulate_gas.txtar
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ gnoland start

# simulate only
gnokey maketx call -pkgpath gno.land/r/simulate -func Hello -gas-fee 1000000ugnot -gas-wanted 2000000 -broadcast -chainid=tendermint_test -simulate only test1
stdout 'GAS USED: 99015'
stdout 'GAS USED: 99339'

# simulate skip
gnokey maketx call -pkgpath gno.land/r/simulate -func Hello -gas-fee 1000000ugnot -gas-wanted 2000000 -broadcast -chainid=tendermint_test -simulate skip test1
stdout 'GAS USED: 99015' # same as simulate only
stdout 'GAS USED: 99339' # same as simulate only


-- package/package.gno --
Expand Down
Loading

0 comments on commit 4958b1c

Please sign in to comment.