mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-08-29 15:11:09 +02:00
multi: Add decayedlog db migration code
This commit adds the migration code for the decayedlog db which is optional and will default to true.
This commit is contained in:
@@ -498,6 +498,7 @@ func TestOptionalMeta(t *testing.T) {
|
||||
om = &OptionalMeta{
|
||||
Versions: map[uint64]string{
|
||||
0: optionalVersions[0].name,
|
||||
1: optionalVersions[1].name,
|
||||
},
|
||||
}
|
||||
err = db.putOptionalMeta(om)
|
||||
@@ -506,7 +507,10 @@ func TestOptionalMeta(t *testing.T) {
|
||||
om1, err := db.fetchOptionalMeta()
|
||||
require.NoError(t, err, "error getting optional meta")
|
||||
require.Equal(t, om, om1, "unexpected empty versions")
|
||||
require.Equal(t, "0: prune_revocation_log", om.String())
|
||||
require.Equal(
|
||||
t, "0: prune_revocation_log, 1: gc_decayed_log",
|
||||
om1.String(),
|
||||
)
|
||||
}
|
||||
|
||||
// TestApplyOptionalVersions checks that the optional migration is applied as
|
||||
@@ -565,6 +569,7 @@ func TestApplyOptionalVersions(t *testing.T) {
|
||||
omExpected := &OptionalMeta{
|
||||
Versions: map[uint64]string{
|
||||
0: optionalVersions[0].name,
|
||||
1: optionalVersions[1].name,
|
||||
},
|
||||
}
|
||||
require.Equal(t, omExpected, om, "unexpected empty versions")
|
||||
|
Reference in New Issue
Block a user