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

lightningnetwork / lnd / 13233514377

10 Feb 2025 04:24AM UTC coverage: 49.335% (-9.5%) from 58.815%
13233514377

Pull #9492

github

yyforyongyu
itest: fix flake in `testForwardInterceptorRestart`

We need to make sure the links are recreated before calling the
interceptor, otherwise we'd get the following error, causing the test to
fail.
```
2025-02-07 15:01:38.991 [ERR] RPCS interceptor.go:624: [/routerrpc.Router/HtlcInterceptor]: fwd (Chan ID=487:3:0, HTLC ID=0) not found
```
Pull Request #9492: itest: fix flake in `testForwardInterceptorRestart`

100803 of 204322 relevant lines covered (49.34%)

1.54 hits per line

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

0.0
/channeldb/migration/lnwire21/true_boolean.go
1
package lnwire
2

3
import (
4
        "io"
5

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

9
// TrueBoolean is a record that indicates true or false using the presence of
10
// the record. If the record is absent, it indicates false. If it is present,
11
// it indicates true.
12
type TrueBoolean struct{}
13

14
// Record returns the tlv record for the boolean entry.
15
func (b *TrueBoolean) Record() tlv.Record {
×
16
        return tlv.MakeStaticRecord(
×
17
                0, b, 0, booleanEncoder, booleanDecoder,
×
18
        )
×
19
}
×
20

21
func booleanEncoder(_ io.Writer, val interface{}, _ *[8]byte) error {
×
22
        if _, ok := val.(*TrueBoolean); ok {
×
23
                return nil
×
24
        }
×
25

26
        return tlv.NewTypeForEncodingErr(val, "TrueBoolean")
×
27
}
28

29
func booleanDecoder(_ io.Reader, val interface{}, _ *[8]byte,
30
        l uint64) error {
×
31

×
32
        if _, ok := val.(*TrueBoolean); ok && (l == 0 || l == 1) {
×
33
                return nil
×
34
        }
×
35

36
        return tlv.NewTypeForEncodingErr(val, "TrueBoolean")
×
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