mirror of
https://github.com/lightninglabs/loop.git
synced 2026-08-13 12:33:03 +02:00
staticaddr: fix multi-address test regressions
This commit is contained in:
parent
f3b3b1a695
commit
0a704b803e
3 changed files with 28 additions and 2 deletions
|
|
@ -159,6 +159,7 @@
|
|||
" \"id\": \"ea6abbf0571c0ba82117ae9f2086614eacea8b2913dc0544b70c00de78353e71\",\n",
|
||||
" \"outpoint\": \"188f55042e49cfa9942cc1f8e216c5e8679a7036e9ee6449d0fcc6c6b81561be:0\",\n",
|
||||
" \"state\": \"LOOPING_IN\",\n",
|
||||
" \"static_address\": \"\",\n",
|
||||
" \"swap_hash\": \"\",\n",
|
||||
" \"value\": \"2500000\"\n",
|
||||
" }\n",
|
||||
|
|
|
|||
|
|
@ -214,6 +214,7 @@
|
|||
" \"id\": \"8fbd6da2f945de2905aa7fa93860744d9387d3464484360e96e467a51de3bc9d\",\n",
|
||||
" \"outpoint\": \"9fa0d5dd5348794aa0541dd2729497f0907890606d044e1c4757bdc848f38df8:0\",\n",
|
||||
" \"state\": \"LOOPING_IN\",\n",
|
||||
" \"static_address\": \"\",\n",
|
||||
" \"swap_hash\": \"\",\n",
|
||||
" \"value\": \"500000\"\n",
|
||||
" }\n",
|
||||
|
|
|
|||
|
|
@ -2847,7 +2847,9 @@ func TestMonitorInvoiceAndHtlcTxDoesNotAdvanceWhenTimeoutDepositTransitionFails(
|
|||
t.Fatalf("htlc conf registration not received: %v", ctx.Err())
|
||||
}
|
||||
|
||||
confRegistration.ConfChan <- nil
|
||||
confRegistration.ConfChan <- invoiceMonitorHtlcConfirmation(
|
||||
t, f, mockLnd,
|
||||
)
|
||||
|
||||
select {
|
||||
case transition := <-depositMgr.transitionChan:
|
||||
|
|
@ -2934,7 +2936,9 @@ func TestMonitorInvoiceAndHtlcTxRetriesOnlyPendingTimeoutDeposits(t *testing.T)
|
|||
t.Fatalf("htlc conf registration not received: %v",
|
||||
runCtx.Err())
|
||||
}
|
||||
confRegistration.ConfChan <- nil
|
||||
confRegistration.ConfChan <- invoiceMonitorHtlcConfirmation(
|
||||
t, f, mockLnd,
|
||||
)
|
||||
|
||||
return resultChan
|
||||
}
|
||||
|
|
@ -3091,6 +3095,7 @@ func newInvoiceMonitorTestFSM(t *testing.T, ctx context.Context,
|
|||
InvoicesClient: invoicesClient,
|
||||
LndClient: mockLnd.Client,
|
||||
ChainParams: mockLnd.ChainParams,
|
||||
Store: &recordingLoopInStore{},
|
||||
}
|
||||
|
||||
f, err := NewFSM(ctx, loopIn, cfg, true)
|
||||
|
|
@ -3099,6 +3104,25 @@ func newInvoiceMonitorTestFSM(t *testing.T, ctx context.Context,
|
|||
return f, depositMgr
|
||||
}
|
||||
|
||||
// invoiceMonitorHtlcConfirmation returns a confirmation containing the HTLC
|
||||
// output expected by the invoice monitor.
|
||||
func invoiceMonitorHtlcConfirmation(t *testing.T, f *FSM,
|
||||
mockLnd *test.LndMockServices) *chainntnfs.TxConfirmation {
|
||||
|
||||
t.Helper()
|
||||
|
||||
htlc, err := f.loopIn.getHtlc(mockLnd.ChainParams)
|
||||
require.NoError(t, err)
|
||||
|
||||
htlcTx := wire.NewMsgTx(2)
|
||||
htlcTx.AddTxOut(&wire.TxOut{
|
||||
Value: int64(f.loopIn.TotalDepositAmount()),
|
||||
PkScript: htlc.PkScript,
|
||||
})
|
||||
|
||||
return &chainntnfs.TxConfirmation{Tx: htlcTx}
|
||||
}
|
||||
|
||||
// failingCancelInvoices records cancellation attempts and returns a configured
|
||||
// error after its release channel is closed.
|
||||
type failingCancelInvoices struct {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue