Skip to content

Commit

Permalink
test(systemtests): fix query block-results in TestStakeUnstake for v2 (
Browse files Browse the repository at this point in the history
…#22782)

(cherry picked from commit 3a2a0ac)

# Conflicts:
#	server/v2/testdata/app.toml
  • Loading branch information
mmsqe authored and mergify[bot] committed Dec 6, 2024
1 parent 8b4dd8e commit 897ca38
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 1 deletion.
44 changes: 44 additions & 0 deletions server/v2/testdata/app.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
[grpc]
# Enable defines if the gRPC server should be enabled.
enable = false
# Address defines the gRPC server address to bind to.
address = 'localhost:9090'
# MaxRecvMsgSize defines the max message size in bytes the server can receive.
# The default value is 10MB.
max-recv-msg-size = 10485760
# MaxSendMsgSize defines the max message size in bytes the server can send.
# The default value is math.MaxInt32.
max-send-msg-size = 2147483647

[mock-server-1]
# Mock field
mock_field = 'default'
# Mock field two
mock_field_two = 1

[server]
# minimum-gas-prices defines the price which a validator is willing to accept for processing a transaction. A transaction's fees must meet the minimum of any denomination specified in this config (e.g. 0.25token1;0.0001token2).
minimum-gas-prices = '0stake'

[store]
# The type of database for application and snapshots databases.
app-db-backend = 'goleveldb'

[store.options]
# State storage database type. Currently we support: "pebble" and "rocksdb"
ss-type = 'pebble'
# State commitment database type. Currently we support: "iavl" and "iavl-v2"
sc-type = 'iavl'

# Pruning options for state commitment
[store.options.sc-pruning-option]
# Number of recent heights to keep on disk.
keep-recent = 2
# Height interval at which pruned heights are removed from disk.
interval = 100

[store.options.iavl-config]
# CacheSize set the size of the iavl tree cache.
cache-size = 100000
# If true, the tree will work like no fast storage and always not upgrade fast storage.
skip-fast-storage-upgrade = true
6 changes: 5 additions & 1 deletion tests/systemtests/staking_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,11 @@ func TestStakeUnstake(t *testing.T) {
assert.Equal(t, int64(8999999), cli.QueryBalance(account1Addr, "stake"))

// check validator has been updated
rsp = cli.CustomQuery("q", "block-results", gjson.Get(rsp, "height").String())
if systest.IsV2() {
rsp = cli.CustomQuery("q", "comet", "block-results", gjson.Get(rsp, "height").String())
} else {
rsp = cli.CustomQuery("q", "block-results", gjson.Get(rsp, "height").String())
}
validatorUpdates := gjson.Get(rsp, "validator_updates").Array()
assert.NotEmpty(t, validatorUpdates)
vpk := gjson.Get(validatorUpdates[0].String(), "pub_key_bytes").String()
Expand Down

0 comments on commit 897ca38

Please sign in to comment.