mirror of
https://github.com/tendermint/tendermint.git
synced 2026-02-08 13:00:08 +00:00
Require app_hash from app to match that from last block
Signed-off-by: Thane Thomson <connect@thanethomson.com>
This commit is contained in:
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user