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

lightningnetwork / lnd / 12343072627

15 Dec 2024 11:09PM UTC coverage: 57.504% (-1.1%) from 58.636%
12343072627

Pull #9315

github

yyforyongyu
contractcourt: offer outgoing htlc one block earlier before its expiry

We need to offer the outgoing htlc one block earlier to make sure when
the expiry height hits, the sweeper will not miss sweeping it in the
same block. This also means the outgoing contest resolver now only does
one thing - watch for preimage spend till height expiry-1, which can
easily be moved into the timeout resolver instead in the future.
Pull Request #9315: Implement `blockbeat`

1445 of 2007 new or added lines in 26 files covered. (72.0%)

19246 existing lines in 249 files now uncovered.

102342 of 177975 relevant lines covered (57.5%)

24772.24 hits per line

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

73.68
/chainio/mocks.go
1
package chainio
2

3
import (
4
        "github.com/btcsuite/btclog/v2"
5
        "github.com/stretchr/testify/mock"
6
)
7

8
// MockConsumer is a mock implementation of the Consumer interface.
9
type MockConsumer struct {
10
        mock.Mock
11
}
12

13
// Compile-time constraint to ensure MockConsumer implements Consumer.
14
var _ Consumer = (*MockConsumer)(nil)
15

16
// Name returns a human-readable string for this subsystem.
17
func (m *MockConsumer) Name() string {
33✔
18
        args := m.Called()
33✔
19
        return args.String(0)
33✔
20
}
33✔
21

22
// ProcessBlock takes a blockbeat and processes it. A receive-only error chan
23
// must be returned.
24
func (m *MockConsumer) ProcessBlock(b Blockbeat) error {
10✔
25
        args := m.Called(b)
10✔
26

10✔
27
        return args.Error(0)
10✔
28
}
10✔
29

30
// MockBlockbeat is a mock implementation of the Blockbeat interface.
31
type MockBlockbeat struct {
32
        mock.Mock
33
}
34

35
// Compile-time constraint to ensure MockBlockbeat implements Blockbeat.
36
var _ Blockbeat = (*MockBlockbeat)(nil)
37

38
// Height returns the current block height.
NEW
39
func (m *MockBlockbeat) Height() int32 {
×
NEW
40
        args := m.Called()
×
NEW
41

×
NEW
42
        return args.Get(0).(int32)
×
NEW
43
}
×
44

45
// logger returns the logger for the blockbeat.
46
func (m *MockBlockbeat) logger() btclog.Logger {
33✔
47
        args := m.Called()
33✔
48

33✔
49
        return args.Get(0).(btclog.Logger)
33✔
50
}
33✔
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