Skip to content

Commit 0694cbb

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 461f0b0 commit 0694cbb

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

sweepbatcher/sweep_batcher_test.go

Lines changed: 6 additions & 6 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)
@@ -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)