sweepbatcher: 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
This commit is contained in:
Slyghtning 2025-12-11 15:40:27 +01:00
parent 76df55b240
commit 417e25463d
No known key found for this signature in database
GPG key ID: F82D456EA023C9BF

View file

@ -638,7 +638,7 @@ type testTransactionPublisher struct {
attempts int
}
var testPublishError = errors.New("test publish error")
var errTestPublish = errors.New("test publish error")
// PublishTransaction publishes the transaction or fails it's the first attempt.
func (p *testTransactionPublisher) PublishTransaction(ctx context.Context,
@ -646,7 +646,7 @@ func (p *testTransactionPublisher) PublishTransaction(ctx context.Context,
p.attempts++
if p.attempts == 1 {
return testPublishError
return errTestPublish
}
return p.WalletKitClient.PublishTransaction(ctx, tx, label)
@ -733,7 +733,7 @@ func testPublishErrorHandler(t *testing.T, store testStore,
}, test.Timeout, eventuallyCheckFrequency)
// The first attempt to publish the batch tx is expected to fail.
require.ErrorIs(t, <-publishErrorChan, testPublishError)
require.ErrorIs(t, <-publishErrorChan, errTestPublish)
// Mine a block to trigger another publishing attempt.
err = lnd.NotifyHeight(601)
@ -4072,8 +4072,8 @@ func testSweepBatcherHandleSweepRace(t *testing.T, store testStore,
<-batcher.initDone
const (
sweepValue btcutil.Amount = 1_000_000
confHeight = 605
sweepValue = btcutil.Amount(1_000_000)
confHeight = 605
)
sweepOutpoint := wire.OutPoint{
@ -4534,8 +4534,8 @@ func TestSweepBatcherConfirmedBatchIncompleteSweeps(t *testing.T) {
swapStore := newLoopdbStore(t, sqlDB)
const (
sweepValue btcutil.Amount = 1_000_000
confHeight = 777
sweepValue = btcutil.Amount(1_000_000)
confHeight = 777
)
ctx := context.Background()