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

lightningnetwork / lnd / 14902063379

08 May 2025 08:24AM UTC coverage: 58.55% (-10.5%) from 69.014%
14902063379

Pull #9692

github

web-flow
Merge 36d8bb2a4 into 43e822c3b
Pull Request #9692: [graph-work-side-branch]: temp side branch for graph work

176 of 307 new or added lines in 25 files covered. (57.33%)

28270 existing lines in 450 files now uncovered.

97382 of 166324 relevant lines covered (58.55%)

1.82 hits per line

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

0.0
/lntest/mock/chainnotifier.go
1
package mock
2

3
import (
4
        "github.com/btcsuite/btcd/chaincfg/chainhash"
5
        "github.com/btcsuite/btcd/wire"
6
        "github.com/lightningnetwork/lnd/chainntnfs"
7
)
8

9
// ChainNotifier is a mock implementation of the ChainNotifier interface.
10
type ChainNotifier struct {
11
        SpendChan chan *chainntnfs.SpendDetail
12
        EpochChan chan *chainntnfs.BlockEpoch
13
        ConfChan  chan *chainntnfs.TxConfirmation
14
}
15

16
// RegisterConfirmationsNtfn returns a ConfirmationEvent that contains a channel
17
// that the tx confirmation will go over.
18
func (c *ChainNotifier) RegisterConfirmationsNtfn(txid *chainhash.Hash,
19
        pkScript []byte, numConfs, heightHint uint32,
UNCOV
20
        opts ...chainntnfs.NotifierOption) (*chainntnfs.ConfirmationEvent, error) {
×
UNCOV
21

×
UNCOV
22
        return &chainntnfs.ConfirmationEvent{
×
UNCOV
23
                Confirmed: c.ConfChan,
×
UNCOV
24
                Cancel:    func() {},
×
25
        }, nil
26
}
27

28
// RegisterSpendNtfn returns a SpendEvent that contains a channel that the spend
29
// details will go over.
30
func (c *ChainNotifier) RegisterSpendNtfn(outpoint *wire.OutPoint,
UNCOV
31
        pkScript []byte, heightHint uint32) (*chainntnfs.SpendEvent, error) {
×
UNCOV
32

×
UNCOV
33
        return &chainntnfs.SpendEvent{
×
UNCOV
34
                Spend:  c.SpendChan,
×
UNCOV
35
                Cancel: func() {},
×
36
        }, nil
37
}
38

39
// RegisterBlockEpochNtfn returns a BlockEpochEvent that contains a channel that
40
// block epochs will go over.
41
func (c *ChainNotifier) RegisterBlockEpochNtfn(blockEpoch *chainntnfs.BlockEpoch) (
UNCOV
42
        *chainntnfs.BlockEpochEvent, error) {
×
UNCOV
43

×
UNCOV
44
        return &chainntnfs.BlockEpochEvent{
×
UNCOV
45
                Epochs: c.EpochChan,
×
UNCOV
46
                Cancel: func() {},
×
47
        }, nil
48
}
49

50
// Start currently returns a dummy value.
51
func (c *ChainNotifier) Start() error {
×
52
        return nil
×
53
}
×
54

55
// Started currently returns a dummy value.
56
func (c *ChainNotifier) Started() bool {
×
57
        return true
×
58
}
×
59

60
// Stop currently returns a dummy value.
61
func (c *ChainNotifier) Stop() error {
×
62
        return nil
×
63
}
×
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