fix replay test

This commit is contained in:
Callum Waters
2022-11-23 16:21:23 +01:00
parent 39ff07e648
commit 6ce3ccca49
3 changed files with 69 additions and 36 deletions
+1 -4
View File
@@ -77,9 +77,6 @@ func NewInMemoryApplication() *Application {
// Tendermint will ensure it is in sync with the application by potentially replaying the blocks it has. If the
// Application returns a 0 appBlockHeight, Tendermint will call InitChain to initialize the application with consensus related data
func (app *Application) Info(_ context.Context, req *types.RequestInfo) (*types.ResponseInfo, error) {
appHash := make([]byte, 8)
binary.PutVarint(appHash, app.state.Size)
// Tendermint expects the application to persist validators, on start-up we need to reload them to memory if they exist
if len(app.valAddrToPubKeyMap) == 0 && app.state.Height > 0 {
validators := app.getValidators()
@@ -97,7 +94,7 @@ func (app *Application) Info(_ context.Context, req *types.RequestInfo) (*types.
Version: version.ABCIVersion,
AppVersion: AppVersion,
LastBlockHeight: app.state.Height,
LastBlockAppHash: appHash,
LastBlockAppHash: app.state.Hash(),
}, nil
}