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

Commit

Permalink
chore(BUX-199): fix linter errors after rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
pawellewandowski98 committed Dec 12, 2023
1 parent b68743a commit bf51fdf
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 9 deletions.
1 change: 1 addition & 0 deletions chainstate/monitor.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package chainstate

import (
"context"

"github.com/BuxOrg/bux/logging"
"github.com/BuxOrg/bux/utils"
"github.com/rs/zerolog"
Expand Down
3 changes: 1 addition & 2 deletions chainstate/transaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@ import (
"sync"
"time"

"github.com/tonicpow/go-minercraft/v2"

"github.com/BuxOrg/bux/utils"
"github.com/tonicpow/go-minercraft/v2"
)

// query will try ALL providers in order and return the first "valid" response based on requirements
Expand Down
2 changes: 1 addition & 1 deletion chainstate/transaction_info.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type TransactionInfo struct {
MerkleProof *bc.MerkleProof `json:"merkle_proof,omitempty"` // mAPI 1.5 ONLY. Should be also supported by Arc in future
}

// Validate validates TransactionInfo by checking if it contains
// Valid validates TransactionInfo by checking if it contains
// BlockHash and MerkleProof (from mAPI) or MerklePath (from Arc)
func (t *TransactionInfo) Valid() bool {
return !(t.BlockHash == "" || t.MerkleProof == nil || t.MerkleProof.TxOrID == "" || len(t.MerkleProof.Nodes) == 0)
Expand Down
9 changes: 5 additions & 4 deletions client_options.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import (
"github.com/mrz1836/go-cache"
"github.com/mrz1836/go-cachestore"
"github.com/mrz1836/go-datastore"
zLogger "github.com/mrz1836/go-logger"
"github.com/newrelic/go-agent/v3/newrelic"
"github.com/rs/zerolog"
"github.com/tonicpow/go-minercraft/v2"
Expand All @@ -36,6 +35,8 @@ type ClientOps func(c *clientOptions)
//
// Useful for starting with the default and then modifying as needed
func defaultClientOptions() *clientOptions {
defaultLogger := logging.GetDefaultLogger()
datastoreLogger := logging.CreateGormLoggerAdapter(defaultLogger, "datastore")
// Set the default options
return &clientOptions{
// Incoming Transaction Checker (lookup external tx via miner for validity)
Expand Down Expand Up @@ -67,7 +68,7 @@ func defaultClientOptions() *clientOptions {
// Blank Datastore config
dataStore: &dataStoreOptions{
ClientInterface: nil,
options: []datastore.ClientOps{datastore.WithLogger(&datastore.DatabaseLogWrapper{GormLoggerInterface: zLogger.NewGormLogger(false, 4)})},
options: []datastore.ClientOps{datastore.WithLogger(&datastore.DatabaseLogWrapper{GormLoggerInterface: datastoreLogger})},
},

// Default http client
Expand Down Expand Up @@ -286,8 +287,8 @@ func WithLogger(customLogger *zerolog.Logger) ClientOps {
// Enable the logger on all external services
datastoreLogger := logging.CreateGormLoggerAdapter(customLogger, "datastore")
cachestoreLogger := logging.CreateGormLoggerAdapter(customLogger, "cachestore")
c.dataStore.options = append(c.dataStore.options, datastore.WithLogger(&datastore.DatabaseLogWrapper{GormLoggerInterface: &datastoreLogger}))
c.cacheStore.options = append(c.cacheStore.options, cachestore.WithLogger(&cachestoreLogger))
c.dataStore.options = append(c.dataStore.options, datastore.WithLogger(&datastore.DatabaseLogWrapper{GormLoggerInterface: datastoreLogger}))
c.cacheStore.options = append(c.cacheStore.options, cachestore.WithLogger(cachestoreLogger))
}
}
}
Expand Down
1 change: 0 additions & 1 deletion cron_job_definitions.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import (
"time"

"github.com/mrz1836/go-datastore"
"github.com/rs/zerolog"
)

// taskCleanupDraftTransactions will clean up all old expired draft transactions
Expand Down
2 changes: 1 addition & 1 deletion taskmanager/cron_jobs.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func (tm *Client) CronJobsInit(target interface{}, cronJobsMap CronJobs) (err er
Handler: func() error {
if taskErr := handler(ctx, target); taskErr != nil {
if tm.options.logger != nil {
tm.options.logger.Error(ctx, "error running %v task: %v", name, taskErr.Error())
tm.options.logger.Error().Msgf("error running %v task: %v", name, taskErr.Error())
}
}
return nil
Expand Down

0 comments on commit bf51fdf

Please sign in to comment.