• 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
/lnwallet/chancloser/mock.go
1
package chancloser
2

3
import (
4
        "sync/atomic"
5

6
        "github.com/btcsuite/btcd/btcec/v2"
7
        "github.com/btcsuite/btcd/btcutil"
8
        "github.com/btcsuite/btcd/chaincfg/chainhash"
9
        "github.com/btcsuite/btcd/wire"
10
        "github.com/lightningnetwork/lnd/chainntnfs"
11
        "github.com/lightningnetwork/lnd/channeldb"
12
        "github.com/lightningnetwork/lnd/fn/v2"
13
        "github.com/lightningnetwork/lnd/input"
14
        "github.com/lightningnetwork/lnd/lnwallet"
15
        "github.com/lightningnetwork/lnd/lnwallet/chainfee"
16
        "github.com/lightningnetwork/lnd/lnwire"
17
        "github.com/stretchr/testify/mock"
18
)
19

20
type dummyAdapters struct {
21
        mock.Mock
22

23
        msgSent atomic.Bool
24

25
        confChan  chan *chainntnfs.TxConfirmation
26
        spendChan chan *chainntnfs.SpendDetail
27
}
28

29
func newDaemonAdapters() *dummyAdapters {
×
30
        return &dummyAdapters{
×
31
                confChan:  make(chan *chainntnfs.TxConfirmation, 1),
×
32
                spendChan: make(chan *chainntnfs.SpendDetail, 1),
×
33
        }
×
34
}
×
35

36
func (d *dummyAdapters) SendMessages(pub btcec.PublicKey,
37
        msgs []lnwire.Message) error {
×
38

×
39
        defer d.msgSent.Store(true)
×
40

×
41
        args := d.Called(pub, msgs)
×
42

×
43
        return args.Error(0)
×
44
}
×
45

46
func (d *dummyAdapters) BroadcastTransaction(tx *wire.MsgTx,
47
        label string) error {
×
48

×
49
        args := d.Called(tx, label)
×
50

×
51
        return args.Error(0)
×
52
}
×
53

54
func (d *dummyAdapters) DisableChannel(op wire.OutPoint) error {
×
55
        args := d.Called(op)
×
56

×
57
        return args.Error(0)
×
58
}
×
59

60
func (d *dummyAdapters) RegisterConfirmationsNtfn(txid *chainhash.Hash,
61
        pkScript []byte, numConfs, heightHint uint32,
62
        opts ...chainntnfs.NotifierOption,
63
) (*chainntnfs.ConfirmationEvent, error) {
×
64

×
65
        args := d.Called(txid, pkScript, numConfs)
×
66

×
67
        err := args.Error(0)
×
68

×
69
        return &chainntnfs.ConfirmationEvent{
×
70
                Confirmed: d.confChan,
×
71
        }, err
×
72
}
×
73

74
func (d *dummyAdapters) RegisterSpendNtfn(outpoint *wire.OutPoint,
75
        pkScript []byte, heightHint uint32) (*chainntnfs.SpendEvent, error) {
×
76

×
77
        args := d.Called(outpoint, pkScript, heightHint)
×
78

×
79
        err := args.Error(0)
×
80

×
81
        return &chainntnfs.SpendEvent{
×
82
                Spend: d.spendChan,
×
83
        }, err
×
84
}
×
85

86
type mockFeeEstimator struct {
87
        mock.Mock
88
}
89

90
func (m *mockFeeEstimator) EstimateFee(chanType channeldb.ChannelType,
91
        localTxOut, remoteTxOut *wire.TxOut,
92
        idealFeeRate chainfee.SatPerKWeight) btcutil.Amount {
×
93

×
94
        args := m.Called(chanType, localTxOut, remoteTxOut, idealFeeRate)
×
95
        return args.Get(0).(btcutil.Amount)
×
96
}
×
97

98
type mockChanObserver struct {
99
        mock.Mock
100
}
101

102
func (m *mockChanObserver) NoDanglingUpdates() bool {
×
103
        args := m.Called()
×
104
        return args.Bool(0)
×
105
}
×
106

107
func (m *mockChanObserver) DisableIncomingAdds() error {
×
108
        args := m.Called()
×
109
        return args.Error(0)
×
110
}
×
111

112
func (m *mockChanObserver) DisableOutgoingAdds() error {
×
113
        args := m.Called()
×
114
        return args.Error(0)
×
115
}
×
116

117
func (m *mockChanObserver) MarkCoopBroadcasted(txn *wire.MsgTx,
118
        local bool) error {
×
119

×
120
        args := m.Called(txn, local)
×
121
        return args.Error(0)
×
122
}
×
123

124
func (m *mockChanObserver) MarkShutdownSent(deliveryAddr []byte,
125
        isInitiator bool) error {
×
126

×
127
        args := m.Called(deliveryAddr, isInitiator)
×
128
        return args.Error(0)
×
129
}
×
130

131
func (m *mockChanObserver) FinalBalances() fn.Option[ShutdownBalances] {
×
132
        args := m.Called()
×
133
        return args.Get(0).(fn.Option[ShutdownBalances])
×
134
}
×
135

136
func (m *mockChanObserver) DisableChannel() error {
×
137
        args := m.Called()
×
138
        return args.Error(0)
×
139
}
×
140

141
type mockErrorReporter struct {
142
        mock.Mock
143
}
144

145
func (m *mockErrorReporter) ReportError(err error) {
×
146
        m.Called(err)
×
147
}
×
148

149
type mockCloseSigner struct {
150
        mock.Mock
151
}
152

153
func (m *mockCloseSigner) CreateCloseProposal(fee btcutil.Amount,
154
        localScript []byte, remoteScript []byte,
155
        closeOpt ...lnwallet.ChanCloseOpt) (
156
        input.Signature, *wire.MsgTx, btcutil.Amount, error) {
×
157

×
158
        args := m.Called(fee, localScript, remoteScript, closeOpt)
×
159

×
160
        return args.Get(0).(input.Signature), args.Get(1).(*wire.MsgTx),
×
161
                args.Get(2).(btcutil.Amount), args.Error(3)
×
162
}
×
163

164
func (m *mockCloseSigner) CompleteCooperativeClose(localSig,
165
        remoteSig input.Signature,
166
        localScript, remoteScript []byte,
167
        fee btcutil.Amount, closeOpt ...lnwallet.ChanCloseOpt,
168
) (*wire.MsgTx, btcutil.Amount, error) {
×
169

×
170
        args := m.Called(
×
171
                localSig, remoteSig, localScript, remoteScript, fee, closeOpt,
×
172
        )
×
173

×
174
        return args.Get(0).(*wire.MsgTx), args.Get(1).(btcutil.Amount),
×
175
                args.Error(2)
×
176
}
×
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