chanbackup/pubsub: add method ManualUpdate
This method inserts channel updates and waits for them to be processed. It will be used to update channel.backup upon LND shutdown.
This commit is contained in:
2 files changed
+105
-6
No files matched your search
@@ -277,4 +277,18 @@ func TestSubSwapperUpdater(t *testing.T) {
|
||||
// Verify that the new set of backups, now has one less after the
|
||||
// sub-swapper switches the new set with the old.
|
||||
assertExpectedBackupSwap(t, swapper, subSwapper, keyRing, backupSet)
|
||||
|
||||
// Check ManualUpdate method.
|
||||
channel, err := genRandomOpenChannelShell()
|
||||
require.NoError(t, err)
|
||||
single := NewSingle(channel, nil)
|
||||
backupSet[channel.FundingOutpoint] = single
|
||||
require.NoError(t, subSwapper.ManualUpdate([]Single{single}))
|
||||
|
||||
// Verify that the state of the backup is as expected.
|
||||
assertExpectedBackupSwap(t, swapper, subSwapper, keyRing, backupSet)
|
||||
|
||||
// Check the case ManualUpdate returns an error.
|
||||
swapper.fail = true
|
||||
require.Error(t, subSwapper.ManualUpdate([]Single{single}))
|
||||
}
|
||||
Reference in new issue
Block a user