mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-08-29 15:11:09 +02:00
sweep: add new state TxFatal
for erroneous sweepings
Also updated the loggings. This new state will be used in the following commit.
This commit is contained in:
@@ -91,6 +91,19 @@ func TestBumpResultValidate(t *testing.T) {
|
||||
}
|
||||
require.ErrorIs(t, b.Validate(), ErrInvalidBumpResult)
|
||||
|
||||
// A failed event without a tx will give an error.
|
||||
b = BumpResult{
|
||||
Event: TxFailed,
|
||||
Err: errDummy,
|
||||
}
|
||||
require.ErrorIs(t, b.Validate(), ErrInvalidBumpResult)
|
||||
|
||||
// A fatal event without a failure reason will give an error.
|
||||
b = BumpResult{
|
||||
Event: TxFailed,
|
||||
}
|
||||
require.ErrorIs(t, b.Validate(), ErrInvalidBumpResult)
|
||||
|
||||
// A confirmed event without fee info will give an error.
|
||||
b = BumpResult{
|
||||
Tx: &wire.MsgTx{},
|
||||
@@ -104,6 +117,13 @@ func TestBumpResultValidate(t *testing.T) {
|
||||
Event: TxPublished,
|
||||
}
|
||||
require.NoError(t, b.Validate())
|
||||
|
||||
// Tx is allowed to be nil in a TxFatal event.
|
||||
b = BumpResult{
|
||||
Event: TxFatal,
|
||||
Err: errDummy,
|
||||
}
|
||||
require.NoError(t, b.Validate())
|
||||
}
|
||||
|
||||
// TestCalcSweepTxWeight checks that the weight of the sweep tx is calculated
|
||||
|
Reference in New Issue
Block a user