mirror of
https://github.com/lightninglabs/loop.git
synced 2026-08-13 12:33:03 +02:00
test: remove unused PayInvoice mock path
Loop no longer pays invoices through LightningClient.PayInvoice. Production payment paths use the router client wrappers. lndclient now also implements PayInvoice on top of router payment APIs, so the old SendPaymentChannel mock path is no longer exercised. Remove the dead PayInvoice mock, its SendPaymentChannel plumbing, and the loop-in resume assertion that watched that channel.
This commit is contained in:
parent
cfe9e401c4
commit
2d446b3b9e
3 changed files with 0 additions and 35 deletions
|
|
@ -655,12 +655,6 @@ func testLoopInResume(t *testing.T, state loopdb.SwapState, expired bool,
|
|||
defer func() {
|
||||
require.NoError(t, <-errChan)
|
||||
|
||||
select {
|
||||
case <-ctx.lnd.SendPaymentChannel:
|
||||
t.Fatal("unexpected payment sent")
|
||||
default:
|
||||
}
|
||||
|
||||
select {
|
||||
case <-ctx.lnd.SendOutputsChannel:
|
||||
t.Fatal("unexpected tx published")
|
||||
|
|
|
|||
|
|
@ -29,21 +29,6 @@ type mockLightningClient struct {
|
|||
wg sync.WaitGroup
|
||||
}
|
||||
|
||||
// PayInvoice pays an invoice.
|
||||
func (h *mockLightningClient) PayInvoice(ctx context.Context, invoice string,
|
||||
maxFee btcutil.Amount,
|
||||
outgoingChannel *uint64) chan lndclient.PaymentResult {
|
||||
|
||||
done := make(chan lndclient.PaymentResult, 1)
|
||||
|
||||
h.lnd.SendPaymentChannel <- PaymentChannelMessage{
|
||||
PaymentRequest: invoice,
|
||||
Done: done,
|
||||
}
|
||||
|
||||
return done
|
||||
}
|
||||
|
||||
// DecodePaymentRequest returns a non-nil payment request.
|
||||
func (h *mockLightningClient) DecodePaymentRequest(_ context.Context,
|
||||
_ string) (*lndclient.PaymentRequest, error) {
|
||||
|
|
|
|||
|
|
@ -48,7 +48,6 @@ func NewMockLnd() *LndMockServices {
|
|||
ChainParams: &chaincfg.TestNet3Params,
|
||||
Versioner: versioner,
|
||||
},
|
||||
SendPaymentChannel: make(chan PaymentChannelMessage),
|
||||
ConfChannel: make(chan *chainntnfs.TxConfirmation),
|
||||
RegisterConfChannel: make(chan *ConfRegistration),
|
||||
RegisterSpendChannel: make(chan *SpendRegistration),
|
||||
|
|
@ -95,12 +94,6 @@ func NewMockLnd() *LndMockServices {
|
|||
return &lnd
|
||||
}
|
||||
|
||||
// PaymentChannelMessage is the data that passed through SendPaymentChannel.
|
||||
type PaymentChannelMessage struct {
|
||||
PaymentRequest string
|
||||
Done chan lndclient.PaymentResult
|
||||
}
|
||||
|
||||
// TrackPaymentMessage is the data that passed through TrackPaymentChannel.
|
||||
type TrackPaymentMessage struct {
|
||||
Hash lntypes.Hash
|
||||
|
|
@ -138,7 +131,6 @@ type PublishHandler func(ctx context.Context, tx *wire.MsgTx,
|
|||
type LndMockServices struct {
|
||||
lndclient.LndServices
|
||||
|
||||
SendPaymentChannel chan PaymentChannelMessage
|
||||
SpendChannel chan *chainntnfs.SpendDetail
|
||||
TxPublishChannel chan *wire.MsgTx
|
||||
SendOutputsChannel chan wire.MsgTx
|
||||
|
|
@ -221,12 +213,6 @@ func (s *LndMockServices) AddTx(tx *wire.MsgTx) {
|
|||
// IsDone checks whether all channels have been fully emptied. If not this may
|
||||
// indicate unexpected behaviour of the code under test.
|
||||
func (s *LndMockServices) IsDone() error {
|
||||
select {
|
||||
case <-s.SendPaymentChannel:
|
||||
return errors.New("SendPaymentChannel not empty")
|
||||
default:
|
||||
}
|
||||
|
||||
select {
|
||||
case <-s.SpendChannel:
|
||||
return errors.New("SpendChannel not empty")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue