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

lightningnetwork / lnd / 12069189652

28 Nov 2024 12:47PM UTC coverage: 58.936% (-0.003%) from 58.939%
12069189652

push

github

web-flow
Merge pull request #9236 from ellemouton/moveGraphDBCode

[1/3] Graph RIP: refactor+graph: move all graph related DB code to the graph package

505 of 618 new or added lines in 48 files covered. (81.72%)

102 existing lines in 17 files now uncovered.

133419 of 226381 relevant lines covered (58.94%)

19519.19 hits per line

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

50.0
/graph/db/codec.go
1
package graphdb
2

3
import (
4
        "encoding/binary"
5
        "io"
6

7
        "github.com/btcsuite/btcd/wire"
8
)
9

10
var (
11
        // byteOrder defines the preferred byte order, which is Big Endian.
12
        byteOrder = binary.BigEndian
13
)
14

15
// WriteOutpoint writes an outpoint to the passed writer using the minimal
16
// amount of bytes possible.
17
func WriteOutpoint(w io.Writer, o *wire.OutPoint) error {
16,951✔
18
        if _, err := w.Write(o.Hash[:]); err != nil {
16,951✔
NEW
19
                return err
×
NEW
20
        }
×
21
        if err := binary.Write(w, byteOrder, o.Index); err != nil {
16,951✔
NEW
22
                return err
×
NEW
23
        }
×
24

25
        return nil
16,951✔
26
}
27

28
// ReadOutpoint reads an outpoint from the passed reader that was previously
29
// written using the WriteOutpoint struct.
30
func ReadOutpoint(r io.Reader, o *wire.OutPoint) error {
18,401✔
31
        if _, err := io.ReadFull(r, o.Hash[:]); err != nil {
18,401✔
NEW
32
                return err
×
NEW
33
        }
×
34
        if err := binary.Read(r, byteOrder, &o.Index); err != nil {
18,401✔
NEW
35
                return err
×
NEW
36
        }
×
37

38
        return nil
18,401✔
39
}
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