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

lightningnetwork / lnd / 14738567887

29 Apr 2025 06:24PM UTC coverage: 69.035% (+10.4%) from 58.592%
14738567887

push

github

web-flow
Merge pull request #9772 from yyforyongyu/show-all-inputs

sweep: return all inputs in `PendingSweeps`

4 of 41 new or added lines in 5 files covered. (9.76%)

35 existing lines in 8 files now uncovered.

133925 of 193996 relevant lines covered (69.03%)

22082.74 hits per line

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

0.0
/cmd/commands/walletrpc_types.go
1
package commands
2

3
import "github.com/lightningnetwork/lnd/lnrpc/walletrpc"
4

5
// PendingSweep is a CLI-friendly type of the walletrpc.PendingSweep proto. We
6
// use this to show more useful string versions of byte slices and enums.
7
//
8
// TODO(yy): Remove this struct as it's easy to forget to update the values
9
// here. Instead, we should rely on the struct defined in the proto
10
// `PendingSweepsResponse` only.
11
type PendingSweep struct {
12
        OutPoint             OutPoint `json:"outpoint"`
13
        WitnessType          string   `json:"witness_type"`
14
        AmountSat            uint32   `json:"amount_sat"`
15
        SatPerVByte          uint32   `json:"sat_per_vbyte"`
16
        BroadcastAttempts    uint32   `json:"broadcast_attempts"`
17
        RequestedSatPerVByte uint32   `json:"requested_sat_per_vbyte"`
18
        Immediate            bool     `json:"immediate"`
19
        Budget               uint64   `json:"budget"`
20
        DeadlineHeight       uint32   `json:"deadline_height"`
21
        MaturityHeight       uint32   `json:"maturity_height"`
22

23
        NextBroadcastHeight uint32 `json:"next_broadcast_height"`
24
        RequestedConfTarget uint32 `json:"requested_conf_target"`
25
        Force               bool   `json:"force"`
26
}
27

28
// NewPendingSweepFromProto converts the walletrpc.PendingSweep proto type into
29
// its corresponding CLI-friendly type.
30
func NewPendingSweepFromProto(pendingSweep *walletrpc.PendingSweep) *PendingSweep {
×
31
        return &PendingSweep{
×
32
                OutPoint:             NewOutPointFromProto(pendingSweep.Outpoint),
×
33
                WitnessType:          pendingSweep.WitnessType.String(),
×
34
                AmountSat:            pendingSweep.AmountSat,
×
35
                SatPerVByte:          uint32(pendingSweep.SatPerVbyte),
×
36
                BroadcastAttempts:    pendingSweep.BroadcastAttempts,
×
37
                RequestedSatPerVByte: uint32(pendingSweep.RequestedSatPerVbyte),
×
38
                Immediate:            pendingSweep.Immediate,
×
39
                Budget:               pendingSweep.Budget,
×
40
                DeadlineHeight:       pendingSweep.DeadlineHeight,
×
NEW
41
                MaturityHeight:       pendingSweep.MaturityHeight,
×
42

×
43
                // Deprecated fields.
×
44
                NextBroadcastHeight: pendingSweep.NextBroadcastHeight,
×
45
                RequestedConfTarget: pendingSweep.RequestedConfTarget,
×
46
                Force:               pendingSweep.Force,
×
47
        }
×
48
}
×
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