Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions lnwallet/aux_test_utils.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
package lnwallet

import (
"github.com/lightningnetwork/lnd/lnwire"
)

// NewTestAuxHtlcDescriptor creates an AuxHtlcDescriptor for testing purposes.
// This function allows tests to create descriptors with specific commit heights
// and entry types, which are normally unexported fields.
func NewTestAuxHtlcDescriptor(
chanID lnwire.ChannelID,
rHash PaymentHash,
timeout uint32,
amount lnwire.MilliSatoshi,
htlcIndex uint64,
parentIndex uint64,
entryType uint8,
customRecords lnwire.CustomRecords,
addHeightLocal uint64,
addHeightRemote uint64,
removeHeightLocal uint64,
removeHeightRemote uint64,
) AuxHtlcDescriptor {

Check failure on line 23 in lnwallet/aux_test_utils.go

View workflow job for this annotation

GitHub Actions / Lint code

multi-line statement should be followed by a newline (whitespace)
return AuxHtlcDescriptor{
Comment on lines +23 to +24

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

According to the repository's style guide (line 286), if a function declaration spans multiple lines, the body should start with an empty line. Please add a blank line after the function signature.

Suggested change
) AuxHtlcDescriptor {
return AuxHtlcDescriptor{
) AuxHtlcDescriptor {
return AuxHtlcDescriptor{
References
  1. If a function declaration spans multiple lines, the body should start with an empty line. (link)

ChanID: chanID,
RHash: rHash,
Timeout: timeout,
Amount: amount,
HtlcIndex: htlcIndex,
ParentIndex: parentIndex,
EntryType: updateType(entryType),
CustomRecords: customRecords,
addCommitHeightLocal: addHeightLocal,
addCommitHeightRemote: addHeightRemote,
removeCommitHeightLocal: removeHeightLocal,
removeCommitHeightRemote: removeHeightRemote,
}
}
Loading