@@ -75,13 +75,13 @@ type stateSerializer struct {
75
75
}
76
76
77
77
// NewStateStoreWithMigration creates a new state store and migrates the old one.
78
- func NewStateStoreWithMigration (ctx context.Context , log * logger.Logger , actionStorePath , stateStorePath string ) (* StateStore , error ) {
79
- err := migrateStateStore (ctx , log , actionStorePath , stateStorePath )
78
+ func NewStateStoreWithMigration (ctx context.Context , log * logger.Logger , actionStorePath , stateStorePath string , storageOpts ... storage. EncryptedOptionFunc ) (* StateStore , error ) {
79
+ err := migrateStateStore (ctx , log , actionStorePath , stateStorePath , storageOpts ... )
80
80
if err != nil {
81
81
return nil , err
82
82
}
83
83
84
- encryptedDiskStore , err := storage .NewEncryptedDiskStore (ctx , stateStorePath )
84
+ encryptedDiskStore , err := storage .NewEncryptedDiskStore (ctx , stateStorePath , storageOpts ... )
85
85
if err != nil {
86
86
return nil , fmt .Errorf ("error instantiating encrypted disk store: %w" , err )
87
87
}
@@ -147,14 +147,14 @@ func NewStateStore(log *logger.Logger, store storeLoad) (*StateStore, error) {
147
147
}, nil
148
148
}
149
149
150
- func migrateStateStore (ctx context.Context , log * logger.Logger , actionStorePath , stateStorePath string ) (err error ) {
150
+ func migrateStateStore (ctx context.Context , log * logger.Logger , actionStorePath , stateStorePath string , storageOpts ... storage. EncryptedOptionFunc ) (err error ) {
151
151
log = log .Named ("state_migration" )
152
152
actionDiskStore , err := storage .NewDiskStore (actionStorePath )
153
153
if err != nil {
154
154
return fmt .Errorf ("error creating disk store: %w" , err )
155
155
}
156
156
157
- stateDiskStore , err := storage .NewEncryptedDiskStore (ctx , stateStorePath )
157
+ stateDiskStore , err := storage .NewEncryptedDiskStore (ctx , stateStorePath , storageOpts ... )
158
158
if err != nil {
159
159
return fmt .Errorf ("error instantiating encrypted disk store: %w" , err )
160
160
}
0 commit comments