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

lightningnetwork / lnd / 16291181271

15 Jul 2025 10:47AM UTC coverage: 57.167% (-10.2%) from 67.349%
16291181271

Pull #9822

github

web-flow
Merge dabf3ae6a into 302551ade
Pull Request #9822: Refactor Payments Code (Head PR for refactor to make sure the itest pass)

650 of 2407 new or added lines in 25 files covered. (27.0%)

28129 existing lines in 454 files now uncovered.

98745 of 172731 relevant lines covered (57.17%)

1.77 hits per line

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

33.33
/payments/db/options.go
1
package paymentsdb
2

3
// StoreOptions holds parameters for the KVStore.
4
type StoreOptions struct {
5
        // NoMigration allows to open the database in readonly mode
6
        NoMigration bool
7

8
        // KeepFailedPaymentAttempts is a flag that determines whether to keep
9
        // failed payment attempts for a settled payment in the db.
10
        keepFailedPaymentAttempts bool
11

12
        // paginationLimit is the maximum number of payments to return per page
13
        // when doing cursor-based pagination.
14
        //
15
        // NOTE: Only used for the SQL store.
16
        paginationLimit int
17
}
18

19
// OptionModifier is a function signature for modifying the default
20
// StoreOptions.
21
type OptionModifier func(*StoreOptions)
22

23
// WithKeepFailedPaymentAttempts sets the KeepFailedPaymentAttempts to n.
24
func WithKeepFailedPaymentAttempts(n bool) OptionModifier {
3✔
25
        return func(o *StoreOptions) {
6✔
26
                o.keepFailedPaymentAttempts = n
3✔
27
        }
3✔
28
}
29

30
// WithNoMigration allows the database to be opened in read only mode by
31
// disabling migrations.
NEW
32
func WithNoMigration(b bool) OptionModifier {
×
NEW
33
        return func(o *StoreOptions) {
×
NEW
34
                o.NoMigration = b
×
NEW
35
        }
×
36
}
37

38
// WithPaginationLimit sets the pagination limit for the SQL store queries that
39
// paginate results.
NEW
40
func WithPaginationLimit(limit int) OptionModifier {
×
NEW
41
        return func(o *StoreOptions) {
×
NEW
42
                o.paginationLimit = limit
×
NEW
43
        }
×
44
}
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