Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
tac0turtle committed May 16, 2023
1 parent 2c2a98b commit 4929ff9
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion baseapp/abci.go
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ func (app *BaseApp) ApplySnapshotChunk(_ context.Context, req *abci.RequestApply
Result: abci.ResponseApplySnapshotChunk_RETRY,
RefetchChunks: []uint32{req.Index},
RejectSenders: []string{req.Sender},
}, err
}, nil

default:
app.logger.Error("failed to restore snapshot", "err", err)
Expand Down
6 changes: 4 additions & 2 deletions baseapp/baseapp_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,12 +131,14 @@ func NewBaseAppSuiteWithSnapshots(t *testing.T, cfg SnapshotsConfig, opts ...fun
txs = append(txs, txBytes)
}

suite.baseApp.FinalizeBlock(context.TODO(), &abci.RequestFinalizeBlock{
_, err := suite.baseApp.FinalizeBlock(context.TODO(), &abci.RequestFinalizeBlock{
Height: height,
Txs: txs,
})
require.NoError(t, err)

suite.baseApp.Commit(context.TODO(), &abci.RequestCommit{})
_, err = suite.baseApp.Commit(context.TODO(), &abci.RequestCommit{})
require.NoError(t, err)

// wait for snapshot to be taken, since it happens asynchronously
if cfg.snapshotInterval > 0 && uint64(height)%cfg.snapshotInterval == 0 {
Expand Down
4 changes: 2 additions & 2 deletions baseapp/snapshot_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ func TestABCI_ApplySnapshotChunk(t *testing.T) {
Sender: "sender",
})
require.NoError(t, err)
require.Equal(t, abci.ResponseApplySnapshotChunk{
require.Equal(t, &abci.ResponseApplySnapshotChunk{
Result: abci.ResponseApplySnapshotChunk_RETRY,
RefetchChunks: []uint32{0},
RejectSenders: []string{"sender"},
Expand All @@ -342,7 +342,7 @@ func TestABCI_ApplySnapshotChunk(t *testing.T) {
Chunk: respChunk.Chunk,
})
require.NoError(t, err)
require.Equal(t, abci.ResponseApplySnapshotChunk{
require.Equal(t, &abci.ResponseApplySnapshotChunk{
Result: abci.ResponseApplySnapshotChunk_ACCEPT,
}, respApply)
}
Expand Down

0 comments on commit 4929ff9

Please sign in to comment.