@@ -59,7 +59,7 @@ type Manager struct {
59
59
opts types.SnapshotOptions
60
60
// multistore is the store from which snapshots are taken.
61
61
multistore types.Snapshotter
62
- logger storetypes .Logger
62
+ logger log .Logger
63
63
64
64
mtx sync.Mutex
65
65
operation operation
@@ -319,7 +319,7 @@ func (m *Manager) Restore(snapshot types.Snapshot) error {
319
319
320
320
dir := m .store .pathSnapshot (snapshot .Height , snapshot .Format )
321
321
if err := os .MkdirAll (dir , 0o750 ); err != nil {
322
- return errorsmod .Wrapf (err , "failed to create snapshot directory %q" , dir )
322
+ return sdkerrors .Wrapf (err , "failed to create snapshot directory %q" , dir )
323
323
}
324
324
325
325
chChunks := m .loadChunkStream (snapshot .Height , snapshot .Format , chChunkIDs )
@@ -362,10 +362,9 @@ func (m *Manager) loadChunkStream(height uint64, format uint32, chunkIDs <-chan
362
362
func (m * Manager ) doRestoreSnapshot (snapshot types.Snapshot , chChunks <- chan io.ReadCloser ) error {
363
363
dir := m .store .pathSnapshot (snapshot .Height , snapshot .Format )
364
364
if err := os .MkdirAll (dir , 0o750 ); err != nil {
365
- return errorsmod .Wrapf (err , "failed to create snapshot directory %q" , dir )
365
+ return sdkerrors .Wrapf (err , "failed to create snapshot directory %q" , dir )
366
366
}
367
367
368
- var nextItem types.SnapshotItem
369
368
streamReader , err := NewStreamReader (chChunks )
370
369
if err != nil {
371
370
return err
@@ -431,7 +430,7 @@ func (m *Manager) RestoreChunk(chunk []byte) (bool, error) {
431
430
}
432
431
433
432
if int (m .restoreChunkIndex ) >= len (m .restoreSnapshot .Metadata .ChunkHashes ) {
434
- return false , errorsmod .Wrap (storetypes .ErrLogic , "received unexpected chunk" )
433
+ return false , sdkerrors .Wrap (sdkerrors .ErrLogic , "received unexpected chunk" )
435
434
}
436
435
437
436
// Check if any errors have occurred yet.
@@ -454,7 +453,7 @@ func (m *Manager) RestoreChunk(chunk []byte) (bool, error) {
454
453
}
455
454
456
455
if err := m .store .saveChunkContent (chunk , m .restoreChunkIndex , m .restoreSnapshot ); err != nil {
457
- return false , errorsmod .Wrapf (err , "save chunk content %d" , m .restoreChunkIndex )
456
+ return false , sdkerrors .Wrapf (err , "save chunk content %d" , m .restoreChunkIndex )
458
457
}
459
458
460
459
// Pass the chunk to the restore, and wait for completion if it was the final one.
@@ -468,7 +467,7 @@ func (m *Manager) RestoreChunk(chunk []byte) (bool, error) {
468
467
// the chunks are all written into files, we can save the snapshot to the db,
469
468
// even if the restoration may not completed yet.
470
469
if err := m .store .saveSnapshot (m .restoreSnapshot ); err != nil {
471
- return false , errorsmod .Wrap (err , "save restoring snapshot" )
470
+ return false , sdkerrors .Wrap (err , "save restoring snapshot" )
472
471
}
473
472
474
473
done := <- m .chRestoreDone
@@ -505,7 +504,7 @@ func (m *Manager) RestoreLocalSnapshot(height uint64, format uint32) error {
505
504
}
506
505
defer m .endLocked ()
507
506
508
- return m .restoreSnapshot (* snapshot , ch )
507
+ return m .doRestoreSnapshot (* snapshot , ch )
509
508
}
510
509
511
510
// sortedExtensionNames sort extension names for deterministic iteration.
0 commit comments