Skip to content

Commit

Permalink
fix syncer_test
Browse files Browse the repository at this point in the history
  • Loading branch information
cmwaters committed Sep 28, 2023
1 parent 23daa74 commit 5ca9225
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions statesync/syncer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -634,7 +634,6 @@ func TestSyncer_applyChunks_RejectSenders(t *testing.T) {
func TestSyncer_verifyApp(t *testing.T) {
boom := errors.New("boom")
const appVersion = 9
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")}

testcases := map[string]struct {
Expand All @@ -647,11 +646,6 @@ func TestSyncer_verifyApp(t *testing.T) {
LastBlockAppHash: []byte("app_hash"),
AppVersion: appVersion,
}, nil, nil},
"invalid app version": {&abci.ResponseInfo{
LastBlockHeight: 3,
LastBlockAppHash: []byte("app_hash"),
AppVersion: 2,
}, nil, appVersionMismatchErr},
"invalid height": {&abci.ResponseInfo{
LastBlockHeight: 5,
LastBlockAppHash: []byte("app_hash"),
Expand All @@ -675,7 +669,7 @@ func TestSyncer_verifyApp(t *testing.T) {
syncer := newSyncer(*cfg, log.NewNopLogger(), connSnapshot, connQuery, stateProvider, "")

connQuery.On("InfoSync", proxy.RequestInfo).Return(tc.response, tc.err)
err := syncer.verifyApp(s, appVersion)
err := syncer.verifyApp(s)
unwrapped := errors.Unwrap(err)
if unwrapped != nil {
err = unwrapped
Expand Down

0 comments on commit 5ca9225

Please sign in to comment.