From ad14e18b2634549242c63da4a8a5ecb5bd01db1b Mon Sep 17 00:00:00 2001 From: n3wbie Date: Wed, 27 Nov 2024 18:56:05 +0900 Subject: [PATCH] test: txtar testing to compare gas used between simulate only and skip --- .../cmd/gnoland/testdata/simulate_gas.txtar | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 gno.land/cmd/gnoland/testdata/simulate_gas.txtar diff --git a/gno.land/cmd/gnoland/testdata/simulate_gas.txtar b/gno.land/cmd/gnoland/testdata/simulate_gas.txtar new file mode 100644 index 00000000000..cd58b4ccc8f --- /dev/null +++ b/gno.land/cmd/gnoland/testdata/simulate_gas.txtar @@ -0,0 +1,28 @@ +# load the package +loadpkg gno.land/r/simulate $WORK/simulate + +# start a new node +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: 50299' + +# 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: 50299' # same as simulate only + + +-- package/package.gno -- +package call_package + +func Render() string { + return "notok" +} + +-- simulate/simulate.gno -- +package simulate + +func Hello() string { + return "Hello" +}