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

lightningnetwork / lnd / 16673052227

01 Aug 2025 10:44AM UTC coverage: 67.016% (-0.03%) from 67.047%
16673052227

Pull #9888

github

web-flow
Merge 1dd8765d7 into 37523b6cb
Pull Request #9888: Attributable failures

325 of 384 new or added lines in 16 files covered. (84.64%)

131 existing lines in 24 files now uncovered.

135611 of 202355 relevant lines covered (67.02%)

21613.83 hits per line

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

90.0
/lnwire/attr_data.go
1
package lnwire
2

3
import "github.com/lightningnetwork/lnd/tlv"
4

5
// AttrDataTlvType  is the TlvType that hosts the attribution data in the
6
// update_fail_htlc wire message.
7
var AttrDataTlvType tlv.TlvType101
8

9
// AttrDataTlvTypeVal is the value of the type of the TLV record for the
10
// attribution data.
11
var AttrDataTlvTypeVal = AttrDataTlvType.TypeVal()
12

13
// AttrDataToExtraData converts the provided attribution data to the extra
14
// opaque data to be included in the wire message.
15
func AttrDataToExtraData(attrData []byte) (ExtraOpaqueData, error) {
190✔
16
        attrRecs := make(tlv.TypeMap)
190✔
17

190✔
18
        attrType := AttrDataTlvType.TypeVal()
190✔
19

190✔
20
        attrRecs[attrType] = attrData
190✔
21

190✔
22
        return NewExtraOpaqueData(attrRecs)
190✔
23
}
190✔
24

25
// ExtraDataToAttrData takes the extra opaque data of the wire message and tries
26
// to extract the attribution data.
27
func ExtraDataToAttrData(extraData ExtraOpaqueData) ([]byte, error) {
125✔
28
        extraRecords, err := extraData.ExtractRecords()
125✔
29
        if err != nil {
125✔
NEW
30
                return nil, err
×
NEW
31
        }
×
32

33
        attrType := AttrDataTlvTypeVal
125✔
34
        var attrData []byte
125✔
35
        if value, ok := extraRecords[attrType]; ok {
244✔
36
                attrData = value
119✔
37
        }
119✔
38

39
        return attrData, nil
125✔
40
}
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