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

lightningnetwork / lnd / 13586005509

28 Feb 2025 10:14AM UTC coverage: 68.629% (+9.9%) from 58.77%
13586005509

Pull #9521

github

web-flow
Merge 37d3a70a5 into 8532955b3
Pull Request #9521: unit: remove GOACC, use Go 1.20 native coverage functionality

129950 of 189351 relevant lines covered (68.63%)

23726.46 hits per line

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

100.0
/feature/required.go
1
package feature
2

3
import (
4
        "fmt"
5

6
        "github.com/lightningnetwork/lnd/lnwire"
7
)
8

9
// ErrUnknownRequired signals that a feature vector requires certain features
10
// that our node is unaware of or does not implement.
11
type ErrUnknownRequired struct {
12
        unknown []lnwire.FeatureBit
13
}
14

15
// NewErrUnknownRequired initializes an ErrUnknownRequired with the unknown
16
// feature bits.
17
func NewErrUnknownRequired(unknown []lnwire.FeatureBit) ErrUnknownRequired {
6✔
18
        return ErrUnknownRequired{
6✔
19
                unknown: unknown,
6✔
20
        }
6✔
21
}
6✔
22

23
// Error returns a human-readable description of the error.
24
func (e ErrUnknownRequired) Error() string {
2✔
25
        return fmt.Sprintf("feature vector contains unknown required "+
2✔
26
                "features: %v", e.unknown)
2✔
27
}
2✔
28

29
// ValidateRequired returns an error if the feature vector contains a non-zero
30
// number of unknown, required feature bits.
31
func ValidateRequired(fv *lnwire.FeatureVector) error {
1,894✔
32
        unknown := fv.UnknownRequiredFeatures()
1,894✔
33
        if len(unknown) > 0 {
1,899✔
34
                return NewErrUnknownRequired(unknown)
5✔
35
        }
5✔
36
        return nil
1,889✔
37
}
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