multi: rename nolint:lll to nolint:ll

Find and replace all nolint instances refering to the `lll` linter and
replace with `ll` which is the name of our custom version of the `lll`
linter which can be used to ignore log lines during linting.

The next commit will do the configuration of the custom linter and
disable the default one.
This commit is contained in:
Elle Mouton committed 2024-12-02 09:14:21 +02:00
1 parent 88f5369066
commit ab7aae0708
123 files changed
+286 -286

No files matched your search

+9 -9
View File
@@ -1372,7 +1372,7 @@ func newRetributionInfo(chanPoint *wire.OutPoint,
// For taproot outputs, we also need to hold onto the second
// level tap tweak as well.
//nolint:lll
//nolint:ll
htlcOutput.secondLevelTapTweak = breachedHtlc.SecondLevelTapTweak
breachedOutputs = append(breachedOutputs, htlcOutput)
@@ -1729,7 +1729,7 @@ func taprootBriefcaseFromRetInfo(retInfo *retributionInfo) *taprootBriefcase {
// For spending from our commitment output on the remote
// commitment, we'll need to stash the control block.
case input.TaprootRemoteCommitSpend:
//nolint:lll
//nolint:ll
tapCase.CtrlBlocks.Val.CommitSweepCtrlBlock = bo.signDesc.ControlBlock
bo.resolutionBlob.WhenSome(func(blob tlv.Blob) {
@@ -1743,7 +1743,7 @@ func taprootBriefcaseFromRetInfo(retInfo *retributionInfo) *taprootBriefcase {
// To spend the revoked output again, we'll store the same
// control block value as above, but in a different place.
case input.TaprootCommitmentRevoke:
//nolint:lll
//nolint:ll
tapCase.CtrlBlocks.Val.RevokeSweepCtrlBlock = bo.signDesc.ControlBlock
bo.resolutionBlob.WhenSome(func(blob tlv.Blob) {
@@ -1765,10 +1765,10 @@ func taprootBriefcaseFromRetInfo(retInfo *retributionInfo) *taprootBriefcase {
copy(firstLevelTweak[:], bo.signDesc.TapTweak)
secondLevelTweak := bo.secondLevelTapTweak
//nolint:lll
//nolint:ll
tapCase.TapTweaks.Val.BreachedHtlcTweaks[resID] = firstLevelTweak
//nolint:lll
//nolint:ll
tapCase.TapTweaks.Val.BreachedSecondLevelHltcTweaks[resID] = secondLevelTweak
}
}
@@ -1788,7 +1788,7 @@ func applyTaprootRetInfo(tapCase *taprootBriefcase,
// For spending from our commitment output on the remote
// commitment, we'll apply the control block.
case input.TaprootRemoteCommitSpend:
//nolint:lll
//nolint:ll
bo.signDesc.ControlBlock = tapCase.CtrlBlocks.Val.CommitSweepCtrlBlock
tapCase.SettledCommitBlob.WhenSomeV(
@@ -1800,7 +1800,7 @@ func applyTaprootRetInfo(tapCase *taprootBriefcase,
// To spend the revoked output again, we'll apply the same
// control block value as above, but to a different place.
case input.TaprootCommitmentRevoke:
//nolint:lll
//nolint:ll
bo.signDesc.ControlBlock = tapCase.CtrlBlocks.Val.RevokeSweepCtrlBlock
tapCase.BreachedCommitBlob.WhenSomeV(
@@ -1816,7 +1816,7 @@ func applyTaprootRetInfo(tapCase *taprootBriefcase,
case input.TaprootHtlcOfferedRevoke:
resID := newResolverID(bo.OutPoint())
//nolint:lll
//nolint:ll
tap1, ok := tapCase.TapTweaks.Val.BreachedHtlcTweaks[resID]
if !ok {
return fmt.Errorf("unable to find taproot "+
@@ -1824,7 +1824,7 @@ func applyTaprootRetInfo(tapCase *taprootBriefcase,
}
bo.signDesc.TapTweak = tap1[:]
//nolint:lll
//nolint:ll
tap2, ok := tapCase.TapTweaks.Val.BreachedSecondLevelHltcTweaks[resID]
if !ok {
return fmt.Errorf("unable to find taproot "+
+16 -16
View File
@@ -1561,7 +1561,7 @@ func encodeTaprootAuxData(w io.Writer, c *ContractResolutions) error {
if c.CommitResolution != nil {
commitResolution := c.CommitResolution
commitSignDesc := commitResolution.SelfOutputSignDesc
//nolint:lll
//nolint:ll
tapCase.CtrlBlocks.Val.CommitSweepCtrlBlock = commitSignDesc.ControlBlock
c.CommitResolution.ResolutionBlob.WhenSome(func(b []byte) {
@@ -1587,21 +1587,21 @@ func encodeTaprootAuxData(w io.Writer, c *ContractResolutions) error {
resID = newResolverID(
htlc.SignedSuccessTx.TxIn[0].PreviousOutPoint,
)
//nolint:lll
//nolint:ll
tapCase.CtrlBlocks.Val.SecondLevelCtrlBlocks[resID] = ctrlBlock
// For HTLCs we need to go to the second level for, we
// also need to store the control block needed to
// publish the second level transaction.
if htlc.SignDetails != nil {
//nolint:lll
//nolint:ll
bridgeCtrlBlock := htlc.SignDetails.SignDesc.ControlBlock
//nolint:lll
//nolint:ll
tapCase.CtrlBlocks.Val.IncomingHtlcCtrlBlocks[resID] = bridgeCtrlBlock
}
} else {
resID = newResolverID(htlc.ClaimOutpoint)
//nolint:lll
//nolint:ll
tapCase.CtrlBlocks.Val.IncomingHtlcCtrlBlocks[resID] = ctrlBlock
}
@@ -1624,23 +1624,23 @@ func encodeTaprootAuxData(w io.Writer, c *ContractResolutions) error {
resID = newResolverID(
htlc.SignedTimeoutTx.TxIn[0].PreviousOutPoint,
)
//nolint:lll
//nolint:ll
tapCase.CtrlBlocks.Val.SecondLevelCtrlBlocks[resID] = ctrlBlock
// For HTLCs we need to go to the second level for, we
// also need to store the control block needed to
// publish the second level transaction.
//
//nolint:lll
//nolint:ll
if htlc.SignDetails != nil {
//nolint:lll
//nolint:ll
bridgeCtrlBlock := htlc.SignDetails.SignDesc.ControlBlock
//nolint:lll
//nolint:ll
tapCase.CtrlBlocks.Val.OutgoingHtlcCtrlBlocks[resID] = bridgeCtrlBlock
}
} else {
resID = newResolverID(htlc.ClaimOutpoint)
//nolint:lll
//nolint:ll
tapCase.CtrlBlocks.Val.OutgoingHtlcCtrlBlocks[resID] = ctrlBlock
}
@@ -1689,11 +1689,11 @@ func decodeTapRootAuxData(r io.Reader, c *ContractResolutions) error {
htlc.SignedSuccessTx.TxIn[0].PreviousOutPoint,
)
//nolint:lll
//nolint:ll
ctrlBlock := tapCase.CtrlBlocks.Val.SecondLevelCtrlBlocks[resID]
htlc.SweepSignDesc.ControlBlock = ctrlBlock
//nolint:lll
//nolint:ll
if htlc.SignDetails != nil {
bridgeCtrlBlock := tapCase.CtrlBlocks.Val.IncomingHtlcCtrlBlocks[resID]
htlc.SignDetails.SignDesc.ControlBlock = bridgeCtrlBlock
@@ -1701,7 +1701,7 @@ func decodeTapRootAuxData(r io.Reader, c *ContractResolutions) error {
} else {
resID = newResolverID(htlc.ClaimOutpoint)
//nolint:lll
//nolint:ll
ctrlBlock := tapCase.CtrlBlocks.Val.IncomingHtlcCtrlBlocks[resID]
htlc.SweepSignDesc.ControlBlock = ctrlBlock
}
@@ -1722,11 +1722,11 @@ func decodeTapRootAuxData(r io.Reader, c *ContractResolutions) error {
htlc.SignedTimeoutTx.TxIn[0].PreviousOutPoint,
)
//nolint:lll
//nolint:ll
ctrlBlock := tapCase.CtrlBlocks.Val.SecondLevelCtrlBlocks[resID]
htlc.SweepSignDesc.ControlBlock = ctrlBlock
//nolint:lll
//nolint:ll
if htlc.SignDetails != nil {
bridgeCtrlBlock := tapCase.CtrlBlocks.Val.OutgoingHtlcCtrlBlocks[resID]
htlc.SignDetails.SignDesc.ControlBlock = bridgeCtrlBlock
@@ -1734,7 +1734,7 @@ func decodeTapRootAuxData(r io.Reader, c *ContractResolutions) error {
} else {
resID = newResolverID(htlc.ClaimOutpoint)
//nolint:lll
//nolint:ll
ctrlBlock := tapCase.CtrlBlocks.Val.OutgoingHtlcCtrlBlocks[resID]
htlc.SweepSignDesc.ControlBlock = ctrlBlock
}
+1 -1
View File
@@ -639,7 +639,7 @@ func (c *ChainArbitrator) Start() error {
// corresponding more restricted resolver, as we don't have to watch
// the chain any longer, only resolve the contracts on the confirmed
// commitment.
//nolint:lll
//nolint:ll
for _, closeChanInfo := range closingChannels {
// We can leave off the CloseContract and ForceCloseChan
// methods as the channel is already closed at this point.
+1 -1
View File
@@ -431,7 +431,7 @@ func (c *chainWatcher) handleUnknownLocalState(
auxResult, err := fn.MapOptionZ(
c.cfg.auxLeafStore,
//nolint:lll
//nolint:ll
func(s lnwallet.AuxLeafStore) fn.Result[lnwallet.CommitDiffAuxResult] {
return s.FetchLeavesFromCommit(
lnwallet.NewAuxChanState(c.cfg.chanState),
+5 -5
View File
@@ -593,11 +593,11 @@ func maybeAugmentTaprootResolvers(chanType channeldb.ChannelType,
switch r := resolver.(type) {
case *commitSweepResolver:
if contractResolutions.CommitResolution != nil {
//nolint:lll
//nolint:ll
r.commitResolution = *contractResolutions.CommitResolution
}
case *htlcOutgoingContestResolver:
//nolint:lll
//nolint:ll
htlcResolutions := contractResolutions.HtlcResolutions.OutgoingHTLCs
for _, htlcRes := range htlcResolutions {
htlcRes := htlcRes
@@ -610,7 +610,7 @@ func maybeAugmentTaprootResolvers(chanType channeldb.ChannelType,
}
case *htlcTimeoutResolver:
//nolint:lll
//nolint:ll
htlcResolutions := contractResolutions.HtlcResolutions.OutgoingHTLCs
for _, htlcRes := range htlcResolutions {
htlcRes := htlcRes
@@ -623,7 +623,7 @@ func maybeAugmentTaprootResolvers(chanType channeldb.ChannelType,
}
case *htlcIncomingContestResolver:
//nolint:lll
//nolint:ll
htlcResolutions := contractResolutions.HtlcResolutions.IncomingHTLCs
for _, htlcRes := range htlcResolutions {
htlcRes := htlcRes
@@ -635,7 +635,7 @@ func maybeAugmentTaprootResolvers(chanType channeldb.ChannelType,
}
}
case *htlcSuccessResolver:
//nolint:lll
//nolint:ll
htlcResolutions := contractResolutions.HtlcResolutions.IncomingHTLCs
for _, htlcRes := range htlcResolutions {
htlcRes := htlcRes
+5 -5
View File
@@ -694,7 +694,7 @@ func TestChannelArbitratorLocalForceClose(t *testing.T) {
// Now notify about the local force close getting confirmed.
//
//nolint:lll
//nolint:ll
chanArb.cfg.ChainEvents.LocalUnilateralClosure <- &LocalUnilateralCloseInfo{
SpendDetail: &chainntnfs.SpendDetail{},
LocalForceCloseSummary: &lnwallet.LocalForceCloseSummary{
@@ -991,7 +991,7 @@ func TestChannelArbitratorLocalForceClosePendingHtlc(t *testing.T) {
},
}
//nolint:lll
//nolint:ll
chanArb.cfg.ChainEvents.LocalUnilateralClosure <- &LocalUnilateralCloseInfo{
SpendDetail: &chainntnfs.SpendDetail{},
LocalForceCloseSummary: &lnwallet.LocalForceCloseSummary{
@@ -1620,7 +1620,7 @@ func TestChannelArbitratorCommitFailure(t *testing.T) {
},
{
closeType: channeldb.LocalForceClose,
//nolint:lll
//nolint:ll
sendEvent: func(chanArb *ChannelArbitrator) {
chanArb.cfg.ChainEvents.LocalUnilateralClosure <- &LocalUnilateralCloseInfo{
SpendDetail: &chainntnfs.SpendDetail{},
@@ -1957,7 +1957,7 @@ func TestChannelArbitratorDanglingCommitForceClose(t *testing.T) {
// resolutions sent since we have none on our
// commitment transaction.
//
//nolint:lll
//nolint:ll
uniCloseInfo := &LocalUnilateralCloseInfo{
SpendDetail: &chainntnfs.SpendDetail{},
LocalForceCloseSummary: &lnwallet.LocalForceCloseSummary{
@@ -2884,7 +2884,7 @@ func TestChannelArbitratorAnchors(t *testing.T) {
},
}
//nolint:lll
//nolint:ll
chanArb.cfg.ChainEvents.LocalUnilateralClosure <- &LocalUnilateralCloseInfo{
SpendDetail: &chainntnfs.SpendDetail{},
LocalForceCloseSummary: &lnwallet.LocalForceCloseSummary{
+1 -1
View File
@@ -28,7 +28,7 @@ const (
// BudgetConfig is a struct that holds the configuration when offering outputs
// to the sweeper.
//
//nolint:lll
//nolint:ll
type BudgetConfig struct {
ToLocal btcutil.Amount `long:"tolocal" description:"The amount in satoshis to allocate as the budget to pay fees when sweeping the to_local output. If set, the budget calculated using the ratio (if set) will be capped at this value."`
ToLocalRatio float64 `long:"tolocalratio" description:"The ratio of the value in to_local output to allocate as the budget to pay fees when sweeping it."`
@@ -220,7 +220,7 @@ func (h *htlcIncomingContestResolver) Resolve(
//
// So we'll insert it at the 3rd index of the witness.
case isTaproot:
//nolint:lll
//nolint:ll
h.htlcResolution.SignedSuccessTx.TxIn[0].Witness[2] = preimage[:]
// Within the witness for the success transaction, the
+2 -2
View File
@@ -242,7 +242,7 @@ func (h *htlcSuccessResolver) broadcastReSignedSuccessTx(immediate bool) (
if !h.outputIncubating {
var secondLevelInput input.HtlcSecondLevelAnchorInput
if isTaproot {
//nolint:lll
//nolint:ll
secondLevelInput = input.MakeHtlcSecondLevelSuccessTaprootInput(
h.htlcResolution.SignedSuccessTx,
h.htlcResolution.SignDetails, h.htlcResolution.Preimage,
@@ -252,7 +252,7 @@ func (h *htlcSuccessResolver) broadcastReSignedSuccessTx(immediate bool) (
),
)
} else {
//nolint:lll
//nolint:ll
secondLevelInput = input.MakeHtlcSecondLevelSuccessAnchorInput(
h.htlcResolution.SignedSuccessTx,
h.htlcResolution.SignDetails, h.htlcResolution.Preimage,
+3 -3
View File
@@ -178,7 +178,7 @@ func (h *htlcTimeoutResolver) claimCleanUp(
// - <sender sig> <receiver sig> <preimage> <success_script>
// <control_block>
case h.isTaproot() && h.htlcResolution.SignedTimeoutTx == nil:
//nolint:lll
//nolint:ll
preimageBytes = spendingInput.Witness[taprootRemotePreimageIndex]
// The witness stack when the remote party sweeps the output on a
@@ -269,7 +269,7 @@ func (h *htlcTimeoutResolver) chainDetailsToWatch() (*wire.OutPoint, []byte, err
// witness script (the last element of the witness stack) to
// re-construct the pkScript we need to watch.
//
//nolint:lll
//nolint:ll
outPointToWatch := h.htlcResolution.SignedTimeoutTx.TxIn[0].PreviousOutPoint
witness := h.htlcResolution.SignedTimeoutTx.TxIn[0].Witness
@@ -825,7 +825,7 @@ func (h *htlcTimeoutResolver) handleCommitSpend(
var csvWitnessType input.StandardWitnessType
if h.isTaproot() {
//nolint:lll
//nolint:ll
csvWitnessType = input.TaprootHtlcOfferedTimeoutSecondLevel
} else {
csvWitnessType = input.HtlcOfferedTimeoutSecondLevel
+4 -4
View File
@@ -290,7 +290,7 @@ func testHtlcTimeoutResolver(t *testing.T, testCase htlcTimeoutTestCase) {
resolutionChan := make(chan ResolutionMsg, 1)
reportChan := make(chan *channeldb.ResolverReport)
//nolint:lll
//nolint:ll
chainCfg := ChannelArbitratorConfig{
ChainArbitratorConfig: ChainArbitratorConfig{
Notifier: notifier,
@@ -371,10 +371,10 @@ func testHtlcTimeoutResolver(t *testing.T, testCase htlcTimeoutTestCase) {
if testCase.timeout {
timeoutTxID := timeoutTx.TxHash()
report := &channeldb.ResolverReport{
OutPoint: timeoutTx.TxIn[0].PreviousOutPoint, //nolint:lll
OutPoint: timeoutTx.TxIn[0].PreviousOutPoint, //nolint:ll
Amount: testHtlcAmt.ToSatoshis(),
ResolverType: channeldb.ResolverTypeOutgoingHtlc, //nolint:lll
ResolverOutcome: channeldb.ResolverOutcomeFirstStage, //nolint:lll
ResolverType: channeldb.ResolverTypeOutgoingHtlc, //nolint:ll
ResolverOutcome: channeldb.ResolverOutcomeFirstStage, //nolint:ll
SpendTxID: &timeoutTxID,
}
+3 -3
View File
@@ -555,7 +555,7 @@ func (u *UtxoNursery) NurseryReport(
// confirmation of the commitment transaction.
switch kid.WitnessType() {
//nolint:lll
//nolint:ll
case input.TaprootHtlcAcceptedSuccessSecondLevel:
fallthrough
case input.HtlcAcceptedSuccessSecondLevel:
@@ -590,7 +590,7 @@ func (u *UtxoNursery) NurseryReport(
// it.
report.AddLimboDirectHtlc(&kid)
//nolint:lll
//nolint:ll
case input.TaprootHtlcAcceptedSuccessSecondLevel:
fallthrough
case input.TaprootHtlcOfferedTimeoutSecondLevel:
@@ -611,7 +611,7 @@ func (u *UtxoNursery) NurseryReport(
// balance.
switch kid.WitnessType() {
//nolint:lll
//nolint:ll
case input.TaprootHtlcAcceptedSuccessSecondLevel:
fallthrough
case input.TaprootHtlcOfferedTimeoutSecondLevel: