diff --git a/aperturedb/interface.go b/aperturedb/interface.go index 8804293..ddd5287 100644 --- a/aperturedb/interface.go +++ b/aperturedb/interface.go @@ -165,7 +165,7 @@ func (t *TransactionExecutor[Q]) ExecTx(ctx context.Context, for i := 0; i < t.opts.numRetries; i++ { // Create the db transaction. - tx, err := t.BatchedQuerier.BeginTx(ctx, txOptions) + tx, err := t.BeginTx(ctx, txOptions) if err != nil { return err } diff --git a/aperturedb/sqlite.go b/aperturedb/sqlite.go index 6fa9964..a8c0a4a 100644 --- a/aperturedb/sqlite.go +++ b/aperturedb/sqlite.go @@ -167,7 +167,7 @@ func NewTestSqliteDB(t *testing.T) *SqliteStore { require.NoError(t, err) t.Cleanup(func() { - require.NoError(t, sqlDB.DB.Close()) + require.NoError(t, sqlDB.Close()) }) return sqlDB diff --git a/challenger/lnd.go b/challenger/lnd.go index e948194..2ac3479 100644 --- a/challenger/lnd.go +++ b/challenger/lnd.go @@ -366,6 +366,7 @@ func (l *LndChallenger) VerifyInvoiceStatus(hash lntypes.Hash, // Block here until our condition is met or the allowed time is // up. The Wait() will return whenever a signal is broadcast. invoiceState, hasInvoice = l.invoiceStates[hash] + //nolint:staticcheck for !(hasInvoice && invoiceState == state) && !timeoutReached { l.invoicesCond.Wait() diff --git a/internal/test/lnd_services_mock.go b/internal/test/lnd_services_mock.go index 08efcfe..d30079f 100644 --- a/internal/test/lnd_services_mock.go +++ b/internal/test/lnd_services_mock.go @@ -81,9 +81,9 @@ func NewMockLnd() *LndMockServices { // Also simulate the cached info that is loaded on startup. info, _ := lightningClient.GetInfo(context.Background()) version, _ := versioner.GetVersion(context.Background()) - lnd.LndServices.NodeAlias = info.Alias + lnd.NodeAlias = info.Alias lnd.LndServices.NodePubkey = info.IdentityPubkey - lnd.LndServices.Version = version + lnd.Version = version lnd.WaitForFinished = func() { chainNotifier.WaitForFinished() diff --git a/onion_store.go b/onion_store.go index 9db77a9..0f947dc 100644 --- a/onion_store.go +++ b/onion_store.go @@ -38,7 +38,7 @@ func newOnionStore(client *clientv3.Client) *onionStore { // StorePrivateKey stores the given private key. func (s *onionStore) StorePrivateKey(privateKey []byte) error { - _, err := s.Client.Put(context.Background(), onionPath, string(privateKey)) + _, err := s.Put(context.Background(), onionPath, string(privateKey)) return err } @@ -58,6 +58,6 @@ func (s *onionStore) PrivateKey() ([]byte, error) { // DeletePrivateKey securely removes the private key from the store. func (s *onionStore) DeletePrivateKey() error { - _, err := s.Client.Delete(context.Background(), onionPath) + _, err := s.Delete(context.Background(), onionPath) return err } diff --git a/proxy/service.go b/proxy/service.go index d7b9626..8f58d03 100644 --- a/proxy/service.go +++ b/proxy/service.go @@ -200,12 +200,12 @@ func prepareServices(services []*Service) error { // There are two supported formats to encode the file // content in: hex and base64. - switch { - case prefix == filePrefixHex: + switch prefix { + case filePrefixHex: newValue := hex.EncodeToString(bytes) service.Headers[key] = newValue - case prefix == filePrefixBase64: + case filePrefixBase64: newValue := base64.StdEncoding.EncodeToString( bytes, )