Skip to content

Commit fe24f19

Browse files
authored
Merge pull request #7508 from positiveblue/fix-linter
multi: make linter happy
2 parents 75ee557 + 4a0a155 commit fe24f19

File tree

6 files changed

+43
-22
lines changed

6 files changed

+43
-22
lines changed

build/version.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ const (
4747

4848
// AppPreRelease MUST only contain characters from semanticAlphabet
4949
// per the semantic versioning spec.
50-
AppPreRelease = "beta.rc2"
50+
AppPreRelease = "beta.rc3"
5151
)
5252

5353
func init() {

config_builder.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -652,7 +652,9 @@ type walletReBroadcaster struct {
652652
}
653653

654654
// newWalletReBroadcaster creates a new instance of the walletReBroadcaster.
655-
func newWalletReBroadcaster(broadcaster *pushtx.Broadcaster) *walletReBroadcaster {
655+
func newWalletReBroadcaster(
656+
broadcaster *pushtx.Broadcaster) *walletReBroadcaster {
657+
656658
return &walletReBroadcaster{
657659
Broadcaster: broadcaster,
658660
}

lnutils/chan.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import (
66
)
77

88
// RecvOrTimeout attempts to recv over chan c, returning the value. If the
9-
// timeout passes before the recv succeeds, an error is returned
9+
// timeout passes before the recv succeeds, an error is returned.
1010
func RecvOrTimeout[T any](c <-chan T, timeout time.Duration) (*T, error) {
1111
select {
1212
case m := <-c:

lnwallet/mock.go

+26-11
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ import (
2121
)
2222

2323
var (
24-
CoinPkScript, _ = hex.DecodeString("001431df1bde03c074d0cf21ea2529427e1499b8f1de")
24+
CoinPkScript, _ = hex.DecodeString(
25+
"001431df1bde03c074d0cf21ea2529427e1499b8f1de",
26+
)
2527
)
2628

2729
// mockWalletController is a mock implementation of the WalletController
@@ -50,6 +52,7 @@ func (w *mockWalletController) FetchInputInfo(
5052
Confirmations: 1,
5153
OutPoint: *prevOut,
5254
}
55+
5356
return utxo, nil
5457
}
5558

@@ -74,8 +77,10 @@ func (w *mockWalletController) NewAddress(AddressType, bool,
7477
string) (btcutil.Address, error) {
7578

7679
addr, _ := btcutil.NewAddressPubKey(
77-
w.RootKey.PubKey().SerializeCompressed(), &chaincfg.MainNetParams,
80+
w.RootKey.PubKey().SerializeCompressed(),
81+
&chaincfg.MainNetParams,
7882
)
83+
7984
return addr, nil
8085
}
8186

@@ -176,6 +181,7 @@ func (w *mockWalletController) ListUnspentWitness(int32, int32,
176181
atomic.AddUint32(&w.index, 1)
177182
var ret []*Utxo
178183
ret = append(ret, utxo)
184+
179185
return ret, nil
180186
}
181187

@@ -200,19 +206,21 @@ func (w *mockWalletController) LeaseOutput(wtxmgr.LockID, wire.OutPoint,
200206
}
201207

202208
// ReleaseOutput currently does nothing.
203-
func (w *mockWalletController) ReleaseOutput(wtxmgr.LockID, wire.OutPoint) error {
209+
func (w *mockWalletController) ReleaseOutput(wtxmgr.LockID,
210+
wire.OutPoint) error {
211+
204212
return nil
205213
}
206214

207-
func (w *mockWalletController) ListLeasedOutputs() ([]*base.ListLeasedOutputResult,
215+
func (w *mockWalletController) ListLeasedOutputs() ([]*base.ListLeasedOutputResult, //nolint:lll
208216
error) {
209217

210218
return nil, nil
211219
}
212220

213221
// FundPsbt currently does nothing.
214-
func (w *mockWalletController) FundPsbt(*psbt.Packet, int32, chainfee.SatPerKWeight,
215-
string, *waddrmgr.KeyScope) (int32, error) {
222+
func (w *mockWalletController) FundPsbt(*psbt.Packet, int32,
223+
chainfee.SatPerKWeight, string, *waddrmgr.KeyScope) (int32, error) {
216224

217225
return 0, nil
218226
}
@@ -228,7 +236,9 @@ func (w *mockWalletController) FinalizePsbt(_ *psbt.Packet, _ string) error {
228236
}
229237

230238
// PublishTransaction sends a transaction to the PublishedTransactions chan.
231-
func (w *mockWalletController) PublishTransaction(tx *wire.MsgTx, _ string) error {
239+
func (w *mockWalletController) PublishTransaction(tx *wire.MsgTx,
240+
_ string) error {
241+
232242
w.PublishedTransactions <- tx
233243
return nil
234244
}
@@ -286,7 +296,8 @@ type mockChainNotifier struct {
286296
// that the tx confirmation will go over.
287297
func (c *mockChainNotifier) RegisterConfirmationsNtfn(txid *chainhash.Hash,
288298
pkScript []byte, numConfs, heightHint uint32,
289-
opts ...chainntnfs.NotifierOption) (*chainntnfs.ConfirmationEvent, error) {
299+
opts ...chainntnfs.NotifierOption) (*chainntnfs.ConfirmationEvent,
300+
error) {
290301

291302
return &chainntnfs.ConfirmationEvent{
292303
Confirmed: c.ConfChan,
@@ -307,8 +318,9 @@ func (c *mockChainNotifier) RegisterSpendNtfn(outpoint *wire.OutPoint,
307318

308319
// RegisterBlockEpochNtfn returns a BlockEpochEvent that contains a channel that
309320
// block epochs will go over.
310-
func (c *mockChainNotifier) RegisterBlockEpochNtfn(blockEpoch *chainntnfs.BlockEpoch) (
311-
*chainntnfs.BlockEpochEvent, error) {
321+
func (c *mockChainNotifier) RegisterBlockEpochNtfn(
322+
blockEpoch *chainntnfs.BlockEpoch) (*chainntnfs.BlockEpochEvent,
323+
error) {
312324

313325
return &chainntnfs.BlockEpochEvent{
314326
Epochs: c.EpochChan,
@@ -339,13 +351,16 @@ func (*mockChainIO) GetBestBlock() (*chainhash.Hash, int32, error) {
339351

340352
func (*mockChainIO) GetUtxo(op *wire.OutPoint, _ []byte,
341353
heightHint uint32, _ <-chan struct{}) (*wire.TxOut, error) {
354+
342355
return nil, nil
343356
}
344357

345358
func (*mockChainIO) GetBlockHash(blockHeight int64) (*chainhash.Hash, error) {
346359
return nil, nil
347360
}
348361

349-
func (*mockChainIO) GetBlock(blockHash *chainhash.Hash) (*wire.MsgBlock, error) {
362+
func (*mockChainIO) GetBlock(blockHash *chainhash.Hash) (*wire.MsgBlock,
363+
error) {
364+
350365
return nil, nil
351366
}

lnwallet/rebroadcaster_test.go

+10-7
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import (
77

88
"github.com/btcsuite/btcd/chaincfg/chainhash"
99
"github.com/btcsuite/btcd/wire"
10-
1110
"github.com/lightningnetwork/lnd/chainntnfs"
1211
"github.com/lightningnetwork/lnd/lnutils"
1312
"github.com/stretchr/testify/require"
@@ -132,7 +131,7 @@ func TestWalletRebroadcaster(t *testing.T) {
132131
ChainIO: chainIO,
133132
}
134133

135-
t.Run("rebroadcast bypass", func(t *testing.T) {
134+
t.Run("rebroadcast bypass", func(t *testing.T) { //nolint:paralleltest
136135
// We'll make a copy of the config, but without the
137136
// broadcaster.
138137
testCfg := *cfg
@@ -148,7 +147,8 @@ func TestWalletRebroadcaster(t *testing.T) {
148147
t, wallet, rebroadcaster, walletController,
149148
)
150149

151-
wallet.Shutdown()
150+
err = wallet.Shutdown()
151+
require.NoError(t, err)
152152

153153
// If we make a new wallet, that has the broadcaster, but
154154
// hasn't started yet, we should see the same behavior.
@@ -162,15 +162,19 @@ func TestWalletRebroadcaster(t *testing.T) {
162162
t, wallet, rebroadcaster, walletController,
163163
)
164164

165-
wallet.Shutdown()
165+
err = wallet.Shutdown()
166+
require.NoError(t, err)
166167
})
167168

168-
t.Run("rebroadcast normal", func(t *testing.T) {
169+
t.Run("rebroadcast normal", func(t *testing.T) { //nolint:paralleltest
169170
wallet, err := NewLightningWallet(*cfg)
170171
require.NoError(t, err)
171172
require.NoError(t, wallet.Startup())
172173

173-
defer wallet.Shutdown()
174+
defer func() {
175+
err = wallet.Shutdown()
176+
require.NoError(t, err)
177+
}()
174178

175179
// Wait for the broadcaster to start.
176180
_, err = lnutils.RecvOrTimeout(
@@ -192,6 +196,5 @@ func TestWalletRebroadcaster(t *testing.T) {
192196
rebroadcaster.confSignal, time.Second,
193197
)
194198
require.NoError(t, err)
195-
196199
})
197200
}

lnwallet/wallet.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -482,7 +482,8 @@ func (l *LightningWallet) PublishTransaction(tx *wire.MsgTx,
482482
const numConfs = 6
483483

484484
txConf, err := l.Cfg.Notifier.RegisterConfirmationsNtfn(
485-
&txHash, tx.TxOut[0].PkScript, numConfs, uint32(bestHeight),
485+
&txHash, tx.TxOut[0].PkScript, numConfs,
486+
uint32(bestHeight),
486487
)
487488
if err != nil {
488489
return

0 commit comments

Comments
 (0)