multi: pass in a MigrationConfig to all optional migrations

Define a MigrationConfig interface that should be used to pass the
config of an optional migration function. An implementation of this
interface is added for migration30 (the only current optional
migration).
This commit is contained in:
Elle Mouton committed 2023-02-16 20:45:08 +02:00
1 parent 33b7b9221a
commit 70e3f8f511
5 files changed
+45 -9

No files matched your search

+8 -2
View File
@@ -103,11 +103,15 @@ func TestMigrateRevocationLog(t *testing.T) {
return nil
}
cfg := &MigrateRevLogConfigImpl{}
migtest.ApplyMigrationWithDB(
t,
beforeMigration,
afterMigration,
MigrateRevocationLog,
func(db kvdb.Backend) error {
return MigrateRevocationLog(db, cfg)
},
false,
)
})
@@ -559,6 +563,8 @@ func BenchmarkMigration(b *testing.B) {
return setupTestLogs(db, c, oldLogs, nil)
}
cfg := &MigrateRevLogConfigImpl{}
// Run the migration test.
migtest.ApplyMigrationWithDB(
b,
@@ -568,7 +574,7 @@ func BenchmarkMigration(b *testing.B) {
b.StartTimer()
defer b.StopTimer()
return MigrateRevocationLog(db)
return MigrateRevocationLog(db, cfg)
},
false,
)