lib/config: Refactor migrations a bit (#5750)
This breaks out config migrations to a separate concept, making it (imho) slightly easier to maintain and get an overview.
This commit is contained in:
@@ -766,6 +766,8 @@ func TestV14ListenAddressesMigration(t *testing.T) {
|
||||
},
|
||||
}
|
||||
|
||||
m := migration{14, migrateToConfigV14}
|
||||
|
||||
for _, tc := range tcs {
|
||||
cfg := Configuration{
|
||||
Version: 13,
|
||||
@@ -774,7 +776,7 @@ func TestV14ListenAddressesMigration(t *testing.T) {
|
||||
DeprecatedRelayServers: tc[1],
|
||||
},
|
||||
}
|
||||
convertV13V14(&cfg)
|
||||
m.apply(&cfg)
|
||||
if cfg.Version != 14 {
|
||||
t.Error("Configuration was not converted")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user