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

lightningnetwork / lnd / 13586005509

28 Feb 2025 10:14AM UTC coverage: 68.629% (+9.9%) from 58.77%
13586005509

Pull #9521

github

web-flow
Merge 37d3a70a5 into 8532955b3
Pull Request #9521: unit: remove GOACC, use Go 1.20 native coverage functionality

129950 of 189351 relevant lines covered (68.63%)

23726.46 hits per line

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

62.5
/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,
20
        opts ...chainntnfs.NotifierOption) (*chainntnfs.ConfirmationEvent, error) {
13✔
21

13✔
22
        return &chainntnfs.ConfirmationEvent{
13✔
23
                Confirmed: c.ConfChan,
13✔
24
                Cancel:    func() {},
16✔
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,
31
        pkScript []byte, heightHint uint32) (*chainntnfs.SpendEvent, error) {
60✔
32

60✔
33
        return &chainntnfs.SpendEvent{
60✔
34
                Spend:  c.SpendChan,
60✔
35
                Cancel: func() {},
86✔
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) (
42
        *chainntnfs.BlockEpochEvent, error) {
243✔
43

243✔
44
        return &chainntnfs.BlockEpochEvent{
243✔
45
                Epochs: c.EpochChan,
243✔
46
                Cancel: func() {},
485✔
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