From b8e0e0b1e1475d131bb81ea83cf969f6b42e4b8a Mon Sep 17 00:00:00 2001 From: Thane Thomson Date: Wed, 30 Mar 2022 19:59:43 -0400 Subject: [PATCH] Require app_hash from app to match that from last block Signed-off-by: Thane Thomson --- test/e2e/tests/app_test.go | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/test/e2e/tests/app_test.go b/test/e2e/tests/app_test.go index 7234a5cde..489bbd099 100644 --- a/test/e2e/tests/app_test.go +++ b/test/e2e/tests/app_test.go @@ -45,6 +45,7 @@ func TestApp_Hash(t *testing.T) { testNode(t, func(ctx context.Context, t *testing.T, node e2e.Node) { client, err := node.Client() require.NoError(t, err) + info, err := client.ABCIInfo(ctx) require.NoError(t, err) require.NotEmpty(t, info.Response.LastBlockAppHash, "expected app to return app hash") @@ -55,13 +56,11 @@ func TestApp_Hash(t *testing.T) { block, err := client.Block(ctx, &info.Response.LastBlockHeight) require.NoError(t, err) - - if info.Response.LastBlockHeight == block.Block.Height { - 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") - } + require.Equal(t, info.Response.LastBlockHeight, block.Block.Height) + require.Equal(t, + fmt.Sprintf("%x", info.Response.LastBlockAppHash), + fmt.Sprintf("%x", block.Block.AppHash.Bytes()), + fmt.Sprintf("app hash does not match last block's app hash at height %d", block.Block.Height)) require.True(t, status.SyncInfo.LatestBlockHeight >= info.Response.LastBlockHeight, "status out of sync with application")