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:
1 parent
1dfb5a0c20
commit
6c2e8b9a00
3 files changed
+68
-16
No files matched your search
@@ -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