• 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

78.95
/lnwire/typed_lease_expiry.go
1
package lnwire
2

3
import (
4
        "io"
5

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

9
const (
10
        // LeaseExpiryType is the type of the experimental record used to
11
        // communicate the expiration of a channel lease throughout the channel
12
        // funding process.
13
        //
14
        // TODO: Decide on actual TLV type. Custom records start at 2^16.
15
        LeaseExpiryRecordType tlv.Type = 1 << 16
16
)
17

18
// LeaseExpiry represents the absolute expiration height of a channel lease. All
19
// outputs that pay directly to the channel initiator are locked until this
20
// height is reached.
21
type LeaseExpiry uint32
22

23
// Record returns a TLV record that can be used to encode/decode the LeaseExpiry
24
// type from a given TLV stream.
25
func (l *LeaseExpiry) Record() tlv.Record {
3✔
26
        return tlv.MakeStaticRecord(
3✔
27
                LeaseExpiryRecordType, l, 4, leaseExpiryEncoder, leaseExpiryDecoder,
3✔
28
        )
3✔
29
}
3✔
30

31
// leaseExpiryEncoder is a custom TLV encoder for the LeaseExpiry record.
32
func leaseExpiryEncoder(w io.Writer, val interface{}, buf *[8]byte) error {
3✔
33
        if v, ok := val.(*LeaseExpiry); ok {
6✔
34
                return tlv.EUint32T(w, uint32(*v), buf)
3✔
35
        }
3✔
36

37
        return tlv.NewTypeForEncodingErr(val, "lnwire.LeaseExpiry")
×
38
}
39

40
// leaseExpiryDecoder is a custom TLV decoder for the LeaseExpiry record.
41
func leaseExpiryDecoder(r io.Reader, val interface{}, buf *[8]byte, l uint64) error {
3✔
42
        if v, ok := val.(*LeaseExpiry); ok {
6✔
43
                var leaseExpiry uint32
3✔
44
                if err := tlv.DUint32(r, &leaseExpiry, buf, l); err != nil {
3✔
45
                        return err
×
46
                }
×
47
                *v = LeaseExpiry(leaseExpiry)
3✔
48
                return nil
3✔
49
        }
50

51
        return tlv.NewTypeForEncodingErr(val, "lnwire.LeaseExpiry")
×
52
}
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