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

lightningnetwork / lnd / 13035292482

29 Jan 2025 03:59PM UTC coverage: 49.3% (-9.5%) from 58.777%
13035292482

Pull #9456

github

mohamedawnallah
docs: update release-notes-0.19.0.md

In this commit, we warn users about the removal
of RPCs `SendToRoute`, `SendToRouteSync`, `SendPayment`,
and `SendPaymentSync` in the next release 0.20.
Pull Request #9456: lnrpc+docs: deprecate warning `SendToRoute`, `SendToRouteSync`, `SendPayment`, and `SendPaymentSync` in Release 0.19

100634 of 204126 relevant lines covered (49.3%)

1.54 hits per line

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

69.23
/macaroons/context.go
1
package macaroons
2

3
import (
4
        "context"
5
        "fmt"
6
)
7

8
var (
9
        // RootKeyIDContextKey is the key to get rootKeyID from context.
10
        RootKeyIDContextKey = contextKey{"rootkeyid"}
11

12
        // ErrContextRootKeyID is used when the supplied context doesn't have
13
        // a root key ID.
14
        ErrContextRootKeyID = fmt.Errorf("failed to read root key ID " +
15
                "from context")
16
)
17

18
// contextKey is the type we use to identify values in the context.
19
type contextKey struct {
20
        Name string
21
}
22

23
// ContextWithRootKeyID passes the root key ID value to context.
24
func ContextWithRootKeyID(ctx context.Context,
25
        value interface{}) context.Context {
3✔
26

3✔
27
        return context.WithValue(ctx, RootKeyIDContextKey, value)
3✔
28
}
3✔
29

30
// RootKeyIDFromContext retrieves the root key ID from context using the key
31
// RootKeyIDContextKey.
32
func RootKeyIDFromContext(ctx context.Context) ([]byte, error) {
3✔
33
        id, ok := ctx.Value(RootKeyIDContextKey).([]byte)
3✔
34
        if !ok {
3✔
35
                return nil, ErrContextRootKeyID
×
36
        }
×
37

38
        // Check that the id is not empty.
39
        if len(id) == 0 {
3✔
40
                return nil, ErrMissingRootKeyID
×
41
        }
×
42

43
        return id, nil
3✔
44
}
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