Skip to content

Commit

Permalink
comments
Browse files Browse the repository at this point in the history
  • Loading branch information
cool-develope committed Dec 6, 2023
1 parent 0598995 commit 6d728b1
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
6 changes: 3 additions & 3 deletions store/snapshots/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ type Manager struct {
extensions map[string]ExtensionSnapshotter
// store is the snapshot store where all completed snapshots are persisted.
store *Store
opts types.SnapshotOptions
opts SnapshotOptions
// commitSnapshotter is the snapshotter for the commitment state.
commitSnapshotter CommitSnapshotter
// storageSnapshotter is the snapshotter for the storage state.
Expand Down Expand Up @@ -75,7 +75,7 @@ const (
var ErrOptsZeroSnapshotInterval = errors.New("snaphot-interval must not be 0")

// NewManager creates a new manager.
func NewManager(store *Store, opts types.SnapshotOptions, commitSnapshotter CommitSnapshotter, storageSnapshotter StorageSnapshotter, extensions map[string]ExtensionSnapshotter, logger log.Logger) *Manager {
func NewManager(store *Store, opts SnapshotOptions, commitSnapshotter CommitSnapshotter, storageSnapshotter StorageSnapshotter, extensions map[string]ExtensionSnapshotter, logger log.Logger) *Manager {
if extensions == nil {
extensions = map[string]ExtensionSnapshotter{}
}
Expand All @@ -85,7 +85,7 @@ func NewManager(store *Store, opts types.SnapshotOptions, commitSnapshotter Comm
commitSnapshotter: commitSnapshotter,
storageSnapshotter: storageSnapshotter,
extensions: extensions,
logger: logger,
logger: logger.With("module", "snapshot_manager"),
}
}

Expand Down
2 changes: 1 addition & 1 deletion store/snapshots/manager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
"cosmossdk.io/store/v2/snapshots/types"
)

var opts = types.NewSnapshotOptions(1500, 2)
var opts = snapshots.NewSnapshotOptions(1500, 2)

func TestManager_List(t *testing.T) {
store := setupStore(t)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package types
package snapshots

// SnapshotOptions defines the snapshot strategy used when determining which
// heights are snapshotted for state sync.
Expand Down
4 changes: 3 additions & 1 deletion store/storage/database.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ import (
"cosmossdk.io/store/v2"
)

// Database is an interface that wraps the storage database methods.
// Database is an interface that wraps the storage database methods. A wrapper
// is useful for instances where you want to perform logic that is identical for all SS
// backends, such as restoring snapshots.
type Database interface {
NewBatch(version uint64) (store.Batch, error)
Has(storeKey string, version uint64, key []byte) (bool, error)
Expand Down

0 comments on commit 6d728b1

Please sign in to comment.