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

lightningnetwork / lnd / 13980275562

20 Mar 2025 10:06PM UTC coverage: 58.6% (-10.2%) from 68.789%
13980275562

Pull #9623

github

web-flow
Merge b9b960345 into 09b674508
Pull Request #9623: Size msg test msg

0 of 1518 new or added lines in 42 files covered. (0.0%)

26603 existing lines in 443 files now uncovered.

96807 of 165200 relevant lines covered (58.6%)

1.82 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