• 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
/lnencrypt/test_utils.go
1
package lnencrypt
2

3
import (
4
        "fmt"
5

6
        "github.com/btcsuite/btcd/btcec/v2"
7
        "github.com/lightningnetwork/lnd/keychain"
8
)
9

10
var (
11
        testWalletPrivKey = []byte{
12
                0x2b, 0xd8, 0x06, 0xc9, 0x7f, 0x0e, 0x00, 0xaf,
13
                0x1a, 0x1f, 0xc3, 0x32, 0x8f, 0xa7, 0x63, 0xa9,
14
                0x26, 0x97, 0x23, 0xc8, 0xdb, 0x8f, 0xac, 0x4f,
15
                0x93, 0xaf, 0x71, 0xdb, 0x18, 0x6d, 0x6e, 0x90,
16
        }
17
)
18

19
type MockKeyRing struct {
20
        Fail bool
21
}
22

23
func (m *MockKeyRing) DeriveNextKey(
24
        keyFam keychain.KeyFamily) (keychain.KeyDescriptor, error) {
×
25

×
26
        return keychain.KeyDescriptor{}, nil
×
27
}
×
28

29
func (m *MockKeyRing) DeriveKey(
30
        keyLoc keychain.KeyLocator) (keychain.KeyDescriptor, error) {
×
31

×
32
        if m.Fail {
×
33
                return keychain.KeyDescriptor{}, fmt.Errorf("fail")
×
34
        }
×
35

36
        _, pub := btcec.PrivKeyFromBytes(testWalletPrivKey)
×
37
        return keychain.KeyDescriptor{
×
38
                PubKey: pub,
×
39
        }, nil
×
40
}
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