Skip to content

Commit

Permalink
(fixup) Update AppVersion
Browse files Browse the repository at this point in the history
  • Loading branch information
tnasu committed Dec 16, 2022
1 parent 8972d6d commit 260207e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 3 additions & 2 deletions statesync/reactor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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,
Expand All @@ -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)}}

Expand Down
3 changes: 2 additions & 1 deletion statesync/syncer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")}

Expand All @@ -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,
Expand Down

0 comments on commit 260207e

Please sign in to comment.