Skip to content

Commit 1f6b28e

Browse files
committed
Fix style issues in sweep_batcher_test.go
- Rename testPublishError to errTestPublish (ST1012) - Add explicit type to all constants in const groups (SA9004) - Fixes staticcheck style warnings
1 parent ffc48dc commit 1f6b28e

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

sweepbatcher/sweep_batcher_test.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -638,15 +638,15 @@ type testTransactionPublisher struct {
638638
attempts int
639639
}
640640

641-
var testPublishError = errors.New("test publish error")
641+
var errTestPublish = errors.New("test publish error")
642642

643643
// PublishTransaction publishes the transaction or fails it's the first attempt.
644644
func (p *testTransactionPublisher) PublishTransaction(ctx context.Context,
645645
tx *wire.MsgTx, label string) error {
646646

647647
p.attempts++
648648
if p.attempts == 1 {
649-
return testPublishError
649+
return errTestPublish
650650
}
651651

652652
return p.WalletKitClient.PublishTransaction(ctx, tx, label)
@@ -733,7 +733,7 @@ func testPublishErrorHandler(t *testing.T, store testStore,
733733
}, test.Timeout, eventuallyCheckFrequency)
734734

735735
// The first attempt to publish the batch tx is expected to fail.
736-
require.ErrorIs(t, <-publishErrorChan, testPublishError)
736+
require.ErrorIs(t, <-publishErrorChan, errTestPublish)
737737

738738
// Mine a block to trigger another publishing attempt.
739739
err = lnd.NotifyHeight(601)
@@ -4072,8 +4072,8 @@ func testSweepBatcherHandleSweepRace(t *testing.T, store testStore,
40724072
<-batcher.initDone
40734073

40744074
const (
4075-
sweepValue btcutil.Amount = 1_000_000
4076-
confHeight = 605
4075+
sweepValue = btcutil.Amount(1_000_000)
4076+
confHeight = 605
40774077
)
40784078

40794079
sweepOutpoint := wire.OutPoint{
@@ -4534,8 +4534,8 @@ func TestSweepBatcherConfirmedBatchIncompleteSweeps(t *testing.T) {
45344534
swapStore := newLoopdbStore(t, sqlDB)
45354535

45364536
const (
4537-
sweepValue btcutil.Amount = 1_000_000
4538-
confHeight = 777
4537+
sweepValue = btcutil.Amount(1_000_000)
4538+
confHeight = 777
45394539
)
45404540

45414541
ctx := context.Background()

0 commit comments

Comments
 (0)