test(systemtest): fix cometbft client (backport #22835) (#22836)

Co-authored-by: Julien Robert <julien@rbrt.fr>
This commit is contained in:
mergify[bot] 2024-12-11 22:04:20 +01:00 committed by GitHub
parent d6d177771d
commit 25d0b700d4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -22,6 +22,22 @@ import (
qtypes "github.com/cosmos/cosmos-sdk/types/query"
)
func TestQueryStatus(t *testing.T) {
systest.Sut.ResetChain(t)
cli := systest.NewCLIWrapper(t, systest.Sut, systest.Verbose)
systest.Sut.StartChain(t)
var resp string
if systest.IsV2() {
resp = cli.CustomQuery("comet", "status")
} else {
resp = cli.CustomQuery("status")
}
// make sure the output has the validator moniker.
assert.Contains(t, resp, "\"moniker\":\"node0\"")
}
func TestQueryNodeInfo(t *testing.T) {
systest.Sut.ResetChain(t)
systest.Sut.StartChain(t)
@ -176,7 +192,6 @@ func TestLatestValidatorSet_GRPCGateway(t *testing.T) {
}
rsp := systest.GetRequest(t, baseurl+tc.url)
assert.Equal(t, len(vals), int(gjson.GetBytes(rsp, "pagination.total").Int()))
})
}
}
@ -213,7 +228,7 @@ func TestValidatorSetByHeight(t *testing.T) {
}
}
func TestValidatorSetByHeight_GRPCRestGateway(t *testing.T) {
func TestValidatorSetByHeight_GRPCGateway(t *testing.T) {
systest.Sut.ResetChain(t)
systest.Sut.StartChain(t)
@ -239,15 +254,17 @@ func TestValidatorSetByHeight_GRPCRestGateway(t *testing.T) {
if tc.expErr {
errMsg := gjson.GetBytes(rsp, "message").String()
assert.Contains(t, errMsg, tc.expErrMsg)
} else {
assert.Equal(t, len(vals), int(gjson.GetBytes(rsp, "pagination.total").Int()))
return
}
assert.Equal(t, len(vals), int(gjson.GetBytes(rsp, "pagination.total").Int()))
})
}
}
func TestABCIQuery(t *testing.T) {
systest.Sut.ResetChain(t)
systest.Sut.StartChain(t)
_ = systest.Sut.AwaitNextBlock(t, time.Second*3)
qc := cmtservice.NewServiceClient(systest.Sut.RPCClient(t))
cdc := codec.NewProtoCodec(codectypes.NewInterfaceRegistry())