mirror of
https://github.com/tendermint/tendermint.git
synced 2026-08-29 04:07:07 +00:00
fix up e2e tests
This commit is contained in:
@@ -42,15 +42,22 @@ func TestApp_Hash(t *testing.T) {
|
||||
require.NoError(t, err)
|
||||
require.NotEmpty(t, info.Response.LastBlockAppHash, "expected app to return app hash")
|
||||
|
||||
block, err := client.Block(ctx, nil)
|
||||
require.NoError(t, err)
|
||||
require.EqualValues(t, info.Response.LastBlockAppHash, block.Block.AppHash,
|
||||
"app hash does not match last block's app hash")
|
||||
// In next-block execution, the app hash is stored in the next block
|
||||
requestedHeight := info.Response.LastBlockHeight + 1
|
||||
|
||||
status, err := client.Status(ctx)
|
||||
require.Eventually(t, func() bool {
|
||||
status, err := client.Status(ctx)
|
||||
require.NoError(t, err)
|
||||
require.NotZero(t, status.SyncInfo.LatestBlockHeight)
|
||||
return status.SyncInfo.LatestBlockHeight >= requestedHeight
|
||||
}, 5*time.Second, 500*time.Millisecond)
|
||||
|
||||
block, err := client.Block(ctx, &requestedHeight)
|
||||
require.NoError(t, err)
|
||||
require.EqualValues(t, info.Response.LastBlockAppHash, status.SyncInfo.LatestAppHash,
|
||||
"app hash does not match node status")
|
||||
require.Equal(t,
|
||||
fmt.Sprintf("%x", info.Response.LastBlockAppHash),
|
||||
fmt.Sprintf("%x", block.Block.AppHash.Bytes()),
|
||||
"app hash does not match last block's app hash")
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user