mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-09-03 20:46:04 +02:00
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:
@@ -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