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

lightningnetwork / lnd / 15561477203

10 Jun 2025 01:54PM UTC coverage: 58.351% (-10.1%) from 68.487%
15561477203

Pull #9356

github

web-flow
Merge 6440b25db into c6d6d4c0b
Pull Request #9356: lnrpc: add incoming/outgoing channel ids filter to forwarding history request

33 of 36 new or added lines in 2 files covered. (91.67%)

28366 existing lines in 455 files now uncovered.

97715 of 167461 relevant lines covered (58.35%)

1.81 hits per line

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

33.33
/lnwallet/btcwallet/driver.go
1
package btcwallet
2

3
import (
4
        "fmt"
5

6
        "github.com/btcsuite/btcwallet/chain"
7
        "github.com/lightningnetwork/lnd/blockcache"
8
        "github.com/lightningnetwork/lnd/lnwallet"
9
)
10

11
const (
12
        walletType = "btcwallet"
13
)
14

15
// createNewWallet creates a new instance of BtcWallet given the proper list of
16
// initialization parameters. This function is the factory function required to
17
// properly create an instance of the lnwallet.WalletDriver struct for
18
// BtcWallet.
UNCOV
19
func createNewWallet(args ...interface{}) (lnwallet.WalletController, error) {
×
UNCOV
20
        if len(args) != 2 {
×
21
                return nil, fmt.Errorf("incorrect number of arguments to .New(...), "+
×
22
                        "expected 2, instead passed %v", len(args))
×
23
        }
×
24

UNCOV
25
        config, ok := args[0].(*Config)
×
UNCOV
26
        if !ok {
×
27
                return nil, fmt.Errorf("first argument to btcdnotifier.New is " +
×
28
                        "incorrect, expected a *rpcclient.ConnConfig")
×
29
        }
×
30

UNCOV
31
        blockCache, ok := args[1].(*blockcache.BlockCache)
×
UNCOV
32
        if !ok {
×
33
                return nil, fmt.Errorf("second argument to btcdnotifier.New is " +
×
34
                        "incorrect, expected a *blockcache.BlockCache")
×
35
        }
×
36

UNCOV
37
        return New(*config, blockCache)
×
38
}
39

40
// init registers a driver for the BtcWallet concrete implementation of the
41
// lnwallet.WalletController interface.
42
func init() {
3✔
43
        // Register the driver.
3✔
44
        driver := &lnwallet.WalletDriver{
3✔
45
                WalletType: walletType,
3✔
46
                New:        createNewWallet,
3✔
47
                BackEnds:   chain.BackEnds,
3✔
48
        }
3✔
49

3✔
50
        if err := lnwallet.RegisterWallet(driver); err != nil {
3✔
51
                panic(fmt.Sprintf("failed to register wallet driver '%s': %v",
×
52
                        walletType, err))
×
53
        }
54
}
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