channeldb: add gossiper message store key migration

In this commit, we introduce a migration for the message store
sub-bucket that will migrate all keys within it to a new key format.
This new key format is composed of the peer's public key, followed by
the short channel ID, followed by the message type. This migration is
needed in order to provide backwards-compatibility with messages that
were previously stored before the introduction of the new key format.
This commit is contained in:
Wilmer Paulino
2019-02-05 17:18:20 -08:00
parent 847b064461
commit 9febc9cc04
4 changed files with 177 additions and 1 deletions

View File

@@ -50,7 +50,7 @@ func applyMigration(t *testing.T, beforeMigration, afterMigration func(d *DB),
if err == nil && shouldFail {
t.Fatal("error wasn't received on migration stage")
} else if err != nil && !shouldFail {
t.Fatal("error was received on migration stage")
t.Fatalf("error was received on migration stage: %v", err)
}
// afterMigration usually used for checking the database state and