Skip to content
This repository was archived by the owner on Apr 2, 2024. It is now read-only.

Commit 5feb311

Browse files
committed
Linter fixes for unused funcs and params
1 parent a23af50 commit 5feb311

16 files changed

+10
-114
lines changed

action_transaction.go

+2-4
Original file line numberDiff line numberDiff line change
@@ -539,9 +539,7 @@ func (c *Client) RevertTransaction(ctx context.Context, id string) error {
539539
transaction.XpubOutputValue = XpubOutputValue{"reverted": 0}
540540
transaction.DeletedAt.Valid = true
541541
transaction.DeletedAt.Time = time.Now()
542-
if err = transaction.Save(ctx); err != nil {
543-
return err
544-
}
542+
err = transaction.Save(ctx)
545543

546-
return nil
544+
return err
547545
}

chainstate/chainstate.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import (
1010
)
1111

1212
// MonitorBlockHeaders will start up a block headers monitor
13-
func (c *Client) MonitorBlockHeaders(ctx context.Context) error {
13+
func (c *Client) MonitorBlockHeaders(_ context.Context) error {
1414
return nil
1515
}
1616

chainstate/client_test.go

-22
Original file line numberDiff line numberDiff line change
@@ -12,28 +12,6 @@ import (
1212
"github.com/tonicpow/go-minercraft"
1313
)
1414

15-
// todo: finish these unit tests!
16-
17-
// TestClient_Close will test the method Close()
18-
func TestClient_Close(t *testing.T) {
19-
// finish test
20-
}
21-
22-
// TestClient_Debug will test the method Debug()
23-
func TestClient_Debug(t *testing.T) {
24-
// finish test
25-
}
26-
27-
// TestClient_IsDebug will test the method IsDebug()
28-
func TestClient_IsDebug(t *testing.T) {
29-
// finish test
30-
}
31-
32-
// TestClient_DebugLog will test the method DebugLog()
33-
func TestClient_DebugLog(t *testing.T) {
34-
// finish test
35-
}
36-
3715
// TestNewClient will test the method NewClient()
3816
func TestNewClient(t *testing.T) {
3917
t.Parallel()

chainstate/mock_minercraft_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ func (m *minerCraftTxOnChain) SubmitTransaction(_ context.Context, miner *minerc
241241
}
242242

243243
func (m *minerCraftTxOnChain) QueryTransaction(_ context.Context, miner *minercraft.Miner,
244-
txID string, opts ...minercraft.QueryTransactionOptFunc) (*minercraft.QueryTransactionResponse, error) {
244+
txID string, _ ...minercraft.QueryTransactionOptFunc) (*minercraft.QueryTransactionResponse, error) {
245245

246246
if txID == onChainExample1TxID && miner.Name == minerTaal.Name {
247247
sig := "304402207ede387e82db1ac38e4286b0a967b4fe1c8446c413b3785ccf86b56009439b39022043931eae02d7337b039f109be41dbd44d0472abd10ed78d7e434824ea8ab01da"
@@ -554,7 +554,7 @@ func (m *minerCraftTxNotFound) SubmitTransaction(_ context.Context, miner *miner
554554
}
555555

556556
func (m *minerCraftTxNotFound) QueryTransaction(_ context.Context, miner *minercraft.Miner,
557-
_ string, opts ...minercraft.QueryTransactionOptFunc) (*minercraft.QueryTransactionResponse, error) {
557+
_ string, _ ...minercraft.QueryTransactionOptFunc) (*minercraft.QueryTransactionResponse, error) {
558558

559559
if miner.Name == minerTaal.Name {
560560
sig := "304402201aae61ec65500cf38af48e552c0ea0c62c7937805a99ff6b2dc62bad1a23c183022027a0bb97890f92d41e7b333e8f3dec106aedcd16b782f2f8b46501e104104322"

chainstate/mock_whatsonchain_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ type whatsOnChainInMempool struct {
244244
whatsOnChainBase
245245
}
246246

247-
func (w *whatsOnChainInMempool) BroadcastTx(_ context.Context, hex string) (string, error) {
247+
func (w *whatsOnChainInMempool) BroadcastTx(_ context.Context, _ string) (string, error) {
248248
return "", errors.New("unexpected response code 500: 257: txn-already-known")
249249
}
250250

client_test.go

-20
Original file line numberDiff line numberDiff line change
@@ -77,16 +77,6 @@ func TestClient_Version(t *testing.T) {
7777
})
7878
}
7979

80-
// TestClient_loadCache will test the method loadCache()
81-
func TestClient_loadCache(t *testing.T) {
82-
// finish test
83-
}
84-
85-
// TestClient_loadDatastore will test the method loadDatastore()
86-
func TestClient_loadDatastore(t *testing.T) {
87-
// finish test
88-
}
89-
9080
// TestClient_Cachestore will test the method Cachestore()
9181
func TestClient_Cachestore(t *testing.T) {
9282
t.Parallel()
@@ -135,16 +125,6 @@ func TestClient_Datastore(t *testing.T) {
135125
})
136126
}
137127

138-
// TestClient_AddModels will test the method AddModels()
139-
func TestClient_AddModels(t *testing.T) {
140-
// finish test
141-
}
142-
143-
// TestClient_Close will test the method Close()
144-
func TestClient_Close(t *testing.T) {
145-
// finish test
146-
}
147-
148128
// TestClient_PaymailClient will test the method PaymailClient()
149129
func TestClient_PaymailClient(t *testing.T) {
150130
t.Parallel()

mock_chainstate_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ func (c *chainStateBase) WhatsOnChain() whatsonchain.ClientInterface {
7979
return nil
8080
}
8181

82-
func (c *chainStateBase) RefreshFeeQuotes(ctx context.Context) error {
82+
func (c *chainStateBase) RefreshFeeQuotes(_ context.Context) error {
8383
return nil
8484
}
8585

model_destinations_test.go

-15
Original file line numberDiff line numberDiff line change
@@ -124,21 +124,6 @@ func TestDestination_GetID(t *testing.T) {
124124
})
125125
}
126126

127-
// TestDestination_BeforeCreating will test the method BeforeCreating()
128-
func TestDestination_BeforeCreating(t *testing.T) {
129-
// finish test
130-
}
131-
132-
// TestDestination_Save will test the method Save()
133-
func TestDestination_Save(t *testing.T) {
134-
// finish test
135-
}
136-
137-
// TestDestination_setLockingScriptForAddress will test the method setLockingScriptForAddress()
138-
func TestDestination_setLockingScriptForAddress(t *testing.T) {
139-
// finish test
140-
}
141-
142127
// TestDestination_setAddress will test the method setAddress()
143128
func TestDestination_setAddress(t *testing.T) {
144129

model_draft_transactions_test.go

-5
Original file line numberDiff line numberDiff line change
@@ -208,11 +208,6 @@ func TestDraftTransaction_getDraftTransactionID(t *testing.T) {
208208
})
209209
}
210210

211-
// TestDraftTransaction_processOutputs process the outputs of the transaction config
212-
func TestDraftTransaction_processOutputs(t *testing.T) {
213-
// todo implement test for this using mock paymail client
214-
}
215-
216211
// TestDraftTransaction_createTransaction create a transaction hex
217212
func TestDraftTransaction_createTransaction(t *testing.T) {
218213

model_options_test.go

-5
Original file line numberDiff line numberDiff line change
@@ -91,11 +91,6 @@ func TestWithEncryptionKey(t *testing.T) {
9191
})
9292
}
9393

94-
// TestWithClient will test the method WithClient()
95-
func TestWithClient(t *testing.T) {
96-
// finish test
97-
}
98-
9994
// TestWithMetadatas will test the method WithMetadatas()
10095
func TestWithMetadatas(t *testing.T) {
10196
t.Parallel()

model_save_test.go

-6
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,2 @@
11
package bux
22

3-
import "testing"
4-
5-
// TestModel_save will test the method Save()
6-
func TestModel_save(t *testing.T) {
7-
// todo: finish test - error cases
8-
}

model_xpubs.go

+2-5
Original file line numberDiff line numberDiff line change
@@ -205,11 +205,8 @@ func (m *Xpub) incrementBalance(ctx context.Context, balanceIncrement int64) err
205205
m.CurrentBalance = uint64(newBalance)
206206

207207
// Fire the after update
208-
if err = m.AfterUpdated(ctx); err != nil {
209-
return err
210-
}
211-
212-
return nil
208+
err = m.AfterUpdated(ctx)
209+
return err
213210
}
214211

215212
// incrementNextNum will atomically update the num of the given chain of the xPub and return it

monitor_event_handler.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ func (b *blockSubscriptionHandler) OnPublish(subscription *centrifuge.Subscripti
7474
}
7575
}
7676

77-
func (b *blockSubscriptionHandler) OnUnsubscribe(subscription *centrifuge.Subscription, e centrifuge.UnsubscribeEvent) {
77+
func (b *blockSubscriptionHandler) OnUnsubscribe(subscription *centrifuge.Subscription, _ centrifuge.UnsubscribeEvent) {
7878

7979
b.logger.Info(b.ctx, fmt.Sprintf("[MONITOR] OnUnsubscribe: %s", subscription.Channel()))
8080

taskmanager/client_test.go

-9
Original file line numberDiff line numberDiff line change
@@ -1,10 +1 @@
11
package taskmanager
2-
3-
import (
4-
"testing"
5-
)
6-
7-
// TestClient_Close will test the method Close()
8-
func TestClient_Close(t *testing.T) {
9-
// todo: finish this test!
10-
}

tester/database_test.go

-12
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,6 @@ import (
77
"github.com/stretchr/testify/require"
88
)
99

10-
// todo: finish unit tests!
11-
12-
// TestAnyTime_Match will test the method Match()
13-
func TestAnyTime_Match(t *testing.T) {
14-
// finish test
15-
}
16-
17-
// TestAnyGUID_Match will test the method Match()
18-
func TestAnyGUID_Match(t *testing.T) {
19-
// finish test
20-
}
21-
2210
// TestSQLiteTestConfig will test the method SQLiteTestConfig()
2311
func TestSQLiteTestConfig(t *testing.T) {
2412
t.Parallel()

utils/scripts_test.go

-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,2 @@
11
package utils
22

3-
import "testing"
4-
5-
func TestGetUnlockingScript(t *testing.T) {
6-
// todo: finish this test!
7-
}

0 commit comments

Comments
 (0)