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

lightningnetwork / lnd / 13523316608

25 Feb 2025 02:12PM UTC coverage: 49.351% (-9.5%) from 58.835%
13523316608

Pull #9549

github

yyforyongyu
routing/chainview: refactor `TestFilteredChainView`

So each test has its own miner and chainView.
Pull Request #9549: Fix unit test flake `TestHistoricalConfDetailsTxIndex`

0 of 120 new or added lines in 1 file covered. (0.0%)

27196 existing lines in 434 files now uncovered.

100945 of 204543 relevant lines covered (49.35%)

1.54 hits per line

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

0.0
/channeldb/migration32/hop.go
1
package migration32
2

3
import (
4
        "github.com/btcsuite/btcd/btcec/v2"
5
        "github.com/lightningnetwork/lnd/tlv"
6
)
7

8
const (
9
        // EncryptedDataOnionType is the type used to include encrypted data
10
        // provided by the receiver in the onion for use in blinded paths.
11
        EncryptedDataOnionType tlv.Type = 10
12

13
        // BlindingPointOnionType is the type used to include receiver provided
14
        // ephemeral keys in the onion that are used in blinded paths.
15
        BlindingPointOnionType tlv.Type = 12
16

17
        // MetadataOnionType is the type used in the onion for the payment
18
        // metadata.
19
        MetadataOnionType tlv.Type = 16
20

21
        // TotalAmtMsatBlindedType is the type used in the onion for the total
22
        // amount field that is included in the final hop for blinded payments.
23
        TotalAmtMsatBlindedType tlv.Type = 18
24
)
25

26
// NewEncryptedDataRecord creates a tlv.Record that encodes the encrypted_data
27
// (type 10) record for an onion payload.
UNCOV
28
func NewEncryptedDataRecord(data *[]byte) tlv.Record {
×
UNCOV
29
        return tlv.MakePrimitiveRecord(EncryptedDataOnionType, data)
×
UNCOV
30
}
×
31

32
// NewBlindingPointRecord creates a tlv.Record that encodes the blinding_point
33
// (type 12) record for an onion payload.
UNCOV
34
func NewBlindingPointRecord(point **btcec.PublicKey) tlv.Record {
×
UNCOV
35
        return tlv.MakePrimitiveRecord(BlindingPointOnionType, point)
×
UNCOV
36
}
×
37

38
// NewMetadataRecord creates a tlv.Record that encodes the metadata (type 10)
39
// for an onion payload.
UNCOV
40
func NewMetadataRecord(metadata *[]byte) tlv.Record {
×
UNCOV
41
        return tlv.MakeDynamicRecord(
×
UNCOV
42
                MetadataOnionType, metadata,
×
UNCOV
43
                func() uint64 {
×
44
                        return uint64(len(*metadata))
×
45
                },
×
46
                tlv.EVarBytes, tlv.DVarBytes,
47
        )
48
}
49

50
// NewTotalAmtMsatBlinded creates a tlv.Record that encodes the
51
// total_amount_msat for the final an onion payload within a blinded route.
UNCOV
52
func NewTotalAmtMsatBlinded(amt *uint64) tlv.Record {
×
UNCOV
53
        return tlv.MakeDynamicRecord(
×
UNCOV
54
                TotalAmtMsatBlindedType, amt, func() uint64 {
×
55
                        return tlv.SizeTUint64(*amt)
×
56
                },
×
57
                tlv.ETUint64, tlv.DTUint64,
58
        )
59
}
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