mirror of
https://github.com/tendermint/tendermint.git
synced 2026-03-27 12:05:02 +00:00
e2e: app hash test cleanup (0.35 backport) (#7350)
This commit is contained in:
@@ -98,6 +98,9 @@ func NewApplication(cfg *Config) (*Application, error) {
|
||||
|
||||
// Info implements ABCI.
|
||||
func (app *Application) Info(req abci.RequestInfo) abci.ResponseInfo {
|
||||
app.state.RLock()
|
||||
defer app.state.RUnlock()
|
||||
|
||||
return abci.ResponseInfo{
|
||||
Version: version.ABCIVersion,
|
||||
AppVersion: 1,
|
||||
|
||||
@@ -46,6 +46,7 @@ func TestApp_Hash(t *testing.T) {
|
||||
|
||||
status, err := client.Status(ctx)
|
||||
require.NoError(t, err)
|
||||
require.NotZero(t, status.SyncInfo.LatestBlockHeight)
|
||||
|
||||
block, err := client.Block(ctx, &info.Response.LastBlockHeight)
|
||||
require.NoError(t, err)
|
||||
@@ -62,6 +63,29 @@ func TestApp_Hash(t *testing.T) {
|
||||
})
|
||||
}
|
||||
|
||||
// Tests that the app and blockstore have and report the same height.
|
||||
func TestApp_Height(t *testing.T) {
|
||||
testNode(t, func(t *testing.T, node e2e.Node) {
|
||||
client, err := node.Client()
|
||||
require.NoError(t, err)
|
||||
info, err := client.ABCIInfo(ctx)
|
||||
require.NoError(t, err)
|
||||
require.NotZero(t, info.Response.LastBlockHeight)
|
||||
|
||||
status, err := client.Status(ctx)
|
||||
require.NoError(t, err)
|
||||
require.NotZero(t, status.SyncInfo.LatestBlockHeight)
|
||||
|
||||
block, err := client.Block(ctx, &info.Response.LastBlockHeight)
|
||||
require.NoError(t, err)
|
||||
|
||||
require.Equal(t, info.Response.LastBlockHeight, block.Block.Height)
|
||||
|
||||
require.True(t, status.SyncInfo.LatestBlockHeight >= info.Response.LastBlockHeight,
|
||||
"status out of sync with application")
|
||||
})
|
||||
}
|
||||
|
||||
// Tests that we can set a value and retrieve it.
|
||||
func TestApp_Tx(t *testing.T) {
|
||||
type broadcastFunc func(context.Context, types.Tx) error
|
||||
|
||||
Reference in New Issue
Block a user