diff --git a/statesync/reactor_test.go b/statesync/reactor_test.go index 82abe3090..ed24c4604 100644 --- a/statesync/reactor_test.go +++ b/statesync/reactor_test.go @@ -242,7 +242,7 @@ func makeMockAppConnSnapshot(appHash string, snapshot *snapshot, chunks []*chunk func makeMockAppConnQuery(appHash string, height int64) *proxymocks.AppConnQuery { connQuery := &proxymocks.AppConnQuery{} connQuery.On("InfoSync", proxy.RequestInfo).Return(&abci.ResponseInfo{ - AppVersion: 9, + AppVersion: testAppVersion, LastBlockHeight: height, LastBlockAppHash: []byte(appHash), }, nil) @@ -257,7 +257,7 @@ func makeTestStateAndCommit(appHash string, height int64) (sm.State, *types.Comm Version: tmstate.Version{ Consensus: tmversion.Consensus{ Block: version.BlockProtocol, - App: 9, + App: testAppVersion, }, Software: version.OCCoreSemVer, @@ -278,6 +278,7 @@ func makeTestStateAndCommit(appHash string, height int64) (sm.State, *types.Comm ConsensusParams: *types.DefaultConsensusParams(), LastHeightConsensusParamsChanged: 1, } + state.ConsensusParams.Version.AppVersion = testAppVersion commit := &types.Commit{BlockID: types.BlockID{Hash: []byte(blockHash)}} diff --git a/statesync/syncer_test.go b/statesync/syncer_test.go index d6e663490..dec3c5ecc 100644 --- a/statesync/syncer_test.go +++ b/statesync/syncer_test.go @@ -621,6 +621,7 @@ func TestSyncer_applyChunks_RejectSenders(t *testing.T) { func TestSyncer_verifyApp(t *testing.T) { boom := errors.New("boom") const appVersion = 9 + const invalidAppVersion = appVersion + 1 appVersionMismatchErr := errors.New("app version mismatch. Expected: 9, got: 2") s := &snapshot{Height: 3, Format: 1, Chunks: 5, Hash: []byte{1, 2, 3}, trustedAppHash: []byte("app_hash")} @@ -637,7 +638,7 @@ func TestSyncer_verifyApp(t *testing.T) { "invalid app version": {&abci.ResponseInfo{ LastBlockHeight: 3, LastBlockAppHash: []byte("app_hash"), - AppVersion: 2, + AppVersion: invalidAppVersion, }, nil, appVersionMismatchErr}, "invalid height": {&abci.ResponseInfo{ LastBlockHeight: 5,