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:
Boris Nagaev 2026-06-11 14:57:04 -05:00
parent cfe9e401c4
commit 2d446b3b9e
No known key found for this signature in database
3 changed files with 0 additions and 35 deletions

View file

@ -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) {

View file

@ -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")