Skip to content

Commit

Permalink
fix(gnoland): speed test & rework directory
Browse files Browse the repository at this point in the history
Signed-off-by: gfanton <[email protected]>
  • Loading branch information
gfanton committed Dec 20, 2024
1 parent e74adaa commit e01d185
Show file tree
Hide file tree
Showing 10 changed files with 870 additions and 821 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,11 @@ func TestingNodeConfig(t TestingTS, gnoroot string, additionalTxs ...gnoland.TxW
txs = append(txs, LoadDefaultPackages(t, creator, gnoroot)...)
txs = append(txs, additionalTxs...)

ggs := cfg.Genesis.AppState.(gnoland.GnoGenesisState)
ggs.Balances = balances
ggs.Txs = txs
ggs.Params = params
cfg.Genesis.AppState = ggs
cfg.Genesis.AppState = gnoland.GnoGenesisState{
Balances: balances,
Txs: txs,
Params: params,
}

return cfg, creator
}
Expand Down Expand Up @@ -97,15 +97,6 @@ func TestingMinimalNodeConfig(t TestingTS, gnoroot string) *gnoland.InMemoryNode
}

func DefaultTestingGenesisConfig(t TestingTS, gnoroot string, self crypto.PubKey, tmconfig *tmcfg.Config) *bft.GenesisDoc {
genState := gnoland.DefaultGenState()
genState.Balances = []gnoland.Balance{
{
Address: crypto.MustAddressFromString(DefaultAccount_Address),
Amount: std.MustParseCoins(ugnot.ValueString(10000000000000)),
},
}
genState.Txs = []gnoland.TxWithMetadata{}
genState.Params = []gnoland.Param{}
return &bft.GenesisDoc{
GenesisTime: time.Now(),
ChainID: tmconfig.ChainID(),
Expand All @@ -125,7 +116,16 @@ func DefaultTestingGenesisConfig(t TestingTS, gnoroot string, self crypto.PubKey
Name: "self",
},
},
AppState: genState,
AppState: gnoland.GnoGenesisState{
Balances: []gnoland.Balance{
{
Address: crypto.MustAddressFromString(DefaultAccount_Address),
Amount: std.MustParseCoins(ugnot.ValueString(10_000_000_000_000)),
},
},
Txs: []gnoland.TxWithMetadata{},
Params: []gnoland.Param{},
},
}
}

Expand Down
4 changes: 2 additions & 2 deletions gno.land/pkg/integration/testdata/adduserfrom.txtar
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ stdout ' "BaseAccount": {'
stdout ' "address": "g1mtmrdmqfu0aryqfl4aw65n35haw2wdjkh5p4cp",'
stdout ' "coins": "10000000ugnot",'
stdout ' "public_key": null,'
stdout ' "account_number": "59",'
stdout ' "account_number": "58",'
stdout ' "sequence": "0"'
stdout ' }'
stdout '}'
! stderr '.+' # empty
! stderr '.+' # empty
6 changes: 3 additions & 3 deletions gno.land/pkg/integration/testdata/gnoland.txtar
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,16 @@ cmp stderr gnoland-already-stop.stderr.golden

-- gnoland-no-arguments.stdout.golden --
-- gnoland-no-arguments.stderr.golden --
"gnoland" error: syntax: gnoland [start|stop|restart]
"gnoland" error: exit status 1
-- gnoland-start.stdout.golden --
node started successfully
-- gnoland-start.stderr.golden --
-- gnoland-already-start.stdout.golden --
node started successfully
-- gnoland-already-start.stderr.golden --
"gnoland start" error: node already started
-- gnoland-stop.stdout.golden --
node stopped successfully
-- gnoland-stop.stderr.golden --
-- gnoland-already-stop.stdout.golden --
node stopped successfully
-- gnoland-already-stop.stderr.golden --
"gnoland stop" error: node not started cannot be stopped
4 changes: 2 additions & 2 deletions gno.land/pkg/integration/testdata/loadpkg_example.txtar
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ loadpkg gno.land/p/demo/ufmt
## start a new node
gnoland start

gnokey maketx addpkg -pkgdir $WORK -pkgpath gno.land/r/importtest -gas-fee 1000000ugnot -gas-wanted 9000000 -broadcast -chainid=tendermint_test test1
gnokey maketx addpkg -pkgdir $WORK -pkgpath gno.land/r/importtest -gas-fee 1000000ugnot -gas-wanted 4000000 -broadcast -chainid=tendermint_test test1
stdout OK!

## execute Render
gnokey maketx call -pkgpath gno.land/r/importtest -func Render -gas-fee 1000000ugnot -gas-wanted 9000000 -args '' -broadcast -chainid=tendermint_test test1
gnokey maketx call -pkgpath gno.land/r/importtest -func Render -gas-fee 1000000ugnot -gas-wanted 4000000 -args '' -broadcast -chainid=tendermint_test test1
stdout '("92054" string)'
stdout OK!

Expand Down
5 changes: 3 additions & 2 deletions gno.land/pkg/integration/testdata/restart.txtar
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
loadpkg gno.land/r/demo/counter $WORK
gnoland start

gnokey maketx call -pkgpath gno.land/r/demo/counter -func Incr -gas-fee 1000000ugnot -gas-wanted 150000 -broadcast -chainid tendermint_test test1
gnokey maketx call -pkgpath gno.land/r/demo/counter -func Incr -gas-fee 1000000ugnot -gas-wanted 100000 -broadcast -chainid tendermint_test test1
stdout '\(1 int\)'

gnoland restart

gnokey maketx call -pkgpath gno.land/r/demo/counter -func Incr -gas-fee 1000000ugnot -gas-wanted 150000 -broadcast -chainid tendermint_test test1
gnokey maketx call -pkgpath gno.land/r/demo/counter -func Incr -gas-fee 1000000ugnot -gas-wanted 100000 -broadcast -chainid tendermint_test test1
stdout '\(2 int\)'

-- counter.gno --
Expand All @@ -21,3 +21,4 @@ func Incr() int {
counter++
return counter
}

Loading

0 comments on commit e01d185

Please sign in to comment.