• 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
/netann/msg_hash.go
1
package netann
2

3
import (
4
        "github.com/btcsuite/btcd/chaincfg/chainhash"
5
)
6

7
// MsgHashTag will prefix the message name and the field name in order to
8
// construct the message tag.
9
const MsgHashTag = "lightning"
10

11
// MsgTag computes the full tag that will be used to prefix a message before
12
// calculating the tagged hash. The tag is constructed as follows:
13
//
14
//        tag = "lightning"||"msg_name"||"field_name"
UNCOV
15
func MsgTag(msgName, fieldName string) []byte {
×
UNCOV
16
        tag := []byte(MsgHashTag)
×
UNCOV
17
        tag = append(tag, []byte(msgName)...)
×
UNCOV
18

×
UNCOV
19
        return append(tag, []byte(fieldName)...)
×
UNCOV
20
}
×
21

22
// MsgHash computes the tagged hash of the given message as follows:
23
//
24
//        tag = "lightning"||"msg_name"||"field_name"
25
//        hash = sha256(sha246(tag) || sha256(tag) || msg)
UNCOV
26
func MsgHash(msgName, fieldName string, msg []byte) *chainhash.Hash {
×
UNCOV
27
        tag := MsgTag(msgName, fieldName)
×
UNCOV
28

×
UNCOV
29
        return chainhash.TaggedHash(tag, msg)
×
UNCOV
30
}
×
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