• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

lightningnetwork / lnd / 13035292482

29 Jan 2025 03:59PM UTC coverage: 49.3% (-9.5%) from 58.777%
13035292482

Pull #9456

github

mohamedawnallah
docs: update release-notes-0.19.0.md

In this commit, we warn users about the removal
of RPCs `SendToRoute`, `SendToRouteSync`, `SendPayment`,
and `SendPaymentSync` in the next release 0.20.
Pull Request #9456: lnrpc+docs: deprecate warning `SendToRoute`, `SendToRouteSync`, `SendPayment`, and `SendPaymentSync` in Release 0.19

100634 of 204126 relevant lines covered (49.3%)

1.54 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/chainntnfs/mocks.go
1
package chainntnfs
2

3
import (
4
        "github.com/btcsuite/btcd/chaincfg/chainhash"
5
        "github.com/btcsuite/btcd/wire"
6
        "github.com/lightningnetwork/lnd/fn/v2"
7
        "github.com/stretchr/testify/mock"
8
)
9

10
// MockMempoolWatcher is a mock implementation of the MempoolWatcher interface.
11
// This is used by other subsystems to mock the behavior of the mempool
12
// watcher.
13
type MockMempoolWatcher struct {
14
        mock.Mock
15
}
16

17
// NewMockMempoolWatcher returns a new instance of a mock mempool watcher.
18
func NewMockMempoolWatcher() *MockMempoolWatcher {
×
19
        return &MockMempoolWatcher{}
×
20
}
×
21

22
// Compile-time check to ensure MockMempoolWatcher implements MempoolWatcher.
23
var _ MempoolWatcher = (*MockMempoolWatcher)(nil)
24

25
// SubscribeMempoolSpent implements the MempoolWatcher interface.
26
func (m *MockMempoolWatcher) SubscribeMempoolSpent(
27
        op wire.OutPoint) (*MempoolSpendEvent, error) {
×
28

×
29
        args := m.Called(op)
×
30

×
31
        if args.Get(0) == nil {
×
32
                return nil, args.Error(1)
×
33
        }
×
34

35
        return args.Get(0).(*MempoolSpendEvent), args.Error(1)
×
36
}
37

38
// CancelMempoolSpendEvent implements the MempoolWatcher interface.
39
func (m *MockMempoolWatcher) CancelMempoolSpendEvent(
40
        sub *MempoolSpendEvent) {
×
41

×
42
        m.Called(sub)
×
43
}
×
44

45
// LookupInputMempoolSpend looks up the mempool to find a spending tx which
46
// spends the given outpoint.
47
func (m *MockMempoolWatcher) LookupInputMempoolSpend(
48
        op wire.OutPoint) fn.Option[wire.MsgTx] {
×
49

×
50
        args := m.Called(op)
×
51

×
52
        return args.Get(0).(fn.Option[wire.MsgTx])
×
53
}
×
54

55
// MockNotifier is a mock implementation of the ChainNotifier interface.
56
type MockChainNotifier struct {
57
        mock.Mock
58
}
59

60
// Compile-time check to ensure MockChainNotifier implements ChainNotifier.
61
var _ ChainNotifier = (*MockChainNotifier)(nil)
62

63
// RegisterConfirmationsNtfn registers an intent to be notified once txid
64
// reaches numConfs confirmations.
65
func (m *MockChainNotifier) RegisterConfirmationsNtfn(txid *chainhash.Hash,
66
        pkScript []byte, numConfs, heightHint uint32,
67
        opts ...NotifierOption) (*ConfirmationEvent, error) {
×
68

×
69
        args := m.Called(txid, pkScript, numConfs, heightHint)
×
70
        if args.Get(0) == nil {
×
71
                return nil, args.Error(1)
×
72
        }
×
73

74
        return args.Get(0).(*ConfirmationEvent), args.Error(1)
×
75
}
76

77
// RegisterSpendNtfn registers an intent to be notified once the target
78
// outpoint is successfully spent within a transaction.
79
func (m *MockChainNotifier) RegisterSpendNtfn(outpoint *wire.OutPoint,
80
        pkScript []byte, heightHint uint32) (*SpendEvent, error) {
×
81

×
82
        args := m.Called(outpoint, pkScript, heightHint)
×
83
        if args.Get(0) == nil {
×
84
                return nil, args.Error(1)
×
85
        }
×
86

87
        return args.Get(0).(*SpendEvent), args.Error(1)
×
88
}
89

90
// RegisterBlockEpochNtfn registers an intent to be notified of each new block
91
// connected to the tip of the main chain.
92
func (m *MockChainNotifier) RegisterBlockEpochNtfn(epoch *BlockEpoch) (
93
        *BlockEpochEvent, error) {
×
94

×
95
        args := m.Called(epoch)
×
96
        if args.Get(0) == nil {
×
97
                return nil, args.Error(1)
×
98
        }
×
99

100
        return args.Get(0).(*BlockEpochEvent), args.Error(1)
×
101
}
102

103
// Start the ChainNotifier. Once started, the implementation should be ready,
104
// and able to receive notification registrations from clients.
105
func (m *MockChainNotifier) Start() error {
×
106
        args := m.Called()
×
107

×
108
        return args.Error(0)
×
109
}
×
110

111
// Started returns true if this instance has been started, and false otherwise.
112
func (m *MockChainNotifier) Started() bool {
×
113
        args := m.Called()
×
114

×
115
        return args.Bool(0)
×
116
}
×
117

118
// Stops the concrete ChainNotifier.
119
func (m *MockChainNotifier) Stop() error {
×
120
        args := m.Called()
×
121

×
122
        return args.Error(0)
×
123
}
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc