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

lightningnetwork / lnd / 14193549836

01 Apr 2025 10:40AM UTC coverage: 69.046% (+0.007%) from 69.039%
14193549836

Pull #9665

github

web-flow
Merge e8825f209 into b01f4e514
Pull Request #9665: kvdb: bump etcd libs to v3.5.12

133439 of 193262 relevant lines covered (69.05%)

22119.45 hits per line

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

100.0
/watchtower/wtdb/migration5/codec.go
1
package migration5
2

3
import (
4
        "encoding/binary"
5
        "fmt"
6
)
7

8
// TowerID is a unique 64-bit identifier allocated to each unique watchtower.
9
// This allows the client to conserve on-disk space by not needing to always
10
// reference towers by their pubkey.
11
type TowerID uint64
12

13
// TowerIDFromBytes constructs a TowerID from the provided byte slice. The
14
// argument must have at least 8 bytes, and should contain the TowerID in
15
// big-endian byte order.
16
func TowerIDFromBytes(towerIDBytes []byte) (TowerID, error) {
6✔
17
        if len(towerIDBytes) != 8 {
7✔
18
                return 0, fmt.Errorf("not enough bytes in tower ID. "+
1✔
19
                        "Expected 8, got: %d", len(towerIDBytes))
1✔
20
        }
1✔
21

22
        return TowerID(byteOrder.Uint64(towerIDBytes)), nil
5✔
23
}
24

25
// Bytes encodes a TowerID into an 8-byte slice in big-endian byte order.
26
func (id TowerID) Bytes() []byte {
15✔
27
        var buf [8]byte
15✔
28
        binary.BigEndian.PutUint64(buf[:], uint64(id))
15✔
29
        return buf[:]
15✔
30
}
15✔
31

32
// SessionIDSize is 33-bytes; it is a serialized, compressed public key.
33
const SessionIDSize = 33
34

35
// SessionID is created from the remote public key of a client, and serves as a
36
// unique identifier and authentication for sending state updates.
37
type SessionID [SessionIDSize]byte
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