mirror of
https://github.com/tendermint/tendermint.git
synced 2026-09-28 10:45:39 +00:00
abci: implement finalize block (#9468)
Adds the `FinalizeBlock` method which replaces `BeginBlock`, `DeliverTx`, and `EndBlock` in a single call.
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")
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -84,7 +84,7 @@ func loadTestnet(t *testing.T) e2e.Testnet {
|
||||
ifd, err := e2e.NewDockerInfrastructureData(m)
|
||||
require.NoError(t, err)
|
||||
|
||||
testnet, err := e2e.LoadTestnet(m, manifestFile, ifd)
|
||||
testnet, err := e2e.LoadTestnet(manifestFile, ifd)
|
||||
require.NoError(t, err)
|
||||
testnetCache[manifestFile] = *testnet
|
||||
return *testnet
|
||||
|
||||
Reference in New Issue
Block a user