diff --git a/statediff/indexer/database/sql/indexer_shared_test.go b/statediff/indexer/database/sql/indexer_shared_test.go index feb492d62eff..0351fb13481d 100644 --- a/statediff/indexer/database/sql/indexer_shared_test.go +++ b/statediff/indexer/database/sql/indexer_shared_test.go @@ -11,7 +11,6 @@ import ( "github.com/stretchr/testify/require" "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/params" "github.com/ethereum/go-ethereum/rlp" "github.com/ethereum/go-ethereum/statediff/indexer/database/sql" "github.com/ethereum/go-ethereum/statediff/indexer/interfaces" @@ -23,7 +22,6 @@ var ( db sql.Database err error ind interfaces.StateDiffIndexer - chainConf = params.MainnetChainConfig ipfsPgGet = `SELECT data FROM public.blocks WHERE key = $1` tx1, tx2, tx3, tx4, tx5, rct1, rct2, rct3, rct4, rct5 []byte diff --git a/statediff/known_gaps.go b/statediff/known_gaps.go index 46d5c6a11cc5..e7d0b7f73444 100644 --- a/statediff/known_gaps.go +++ b/statediff/known_gaps.go @@ -64,7 +64,7 @@ type KnownGapsState struct { statediffMetrics statediffMetricsHandles } -// Unused +// Create a new KnownGapsState struct, currently unused. func NewKnownGapsState(checkForGaps bool, processingKey int64, expectedDifference *big.Int, errorState bool, writeFilePath string, db sql.Database, statediffMetrics statediffMetricsHandles) *KnownGapsState { @@ -111,8 +111,8 @@ func (kg *KnownGapsState) pushKnownGaps(startingBlockNumber *big.Int, endingBloc } log.Info("Updating Metrics for the start and end block") - //kg.statediffMetrics.knownGapStart.Update(startingBlockNumber.Int64()) - //kg.statediffMetrics.knownGapEnd.Update(endingBlockNumber.Int64()) + kg.statediffMetrics.knownGapStart.Update(startingBlockNumber.Int64()) + kg.statediffMetrics.knownGapEnd.Update(endingBlockNumber.Int64()) var writeErr error log.Info("Writing known gaps to the DB") @@ -227,11 +227,11 @@ func (kg *KnownGapsState) upsertKnownGapsFile(knownGaps models.KnownGapsModel) e func (kg *KnownGapsState) writeSqlFileStmtToDb() error { log.Info("Writing the local SQL file for KnownGaps to the DB") - file, ioErr := ioutil.ReadFile(kg.writeFilePath) + file, err := ioutil.ReadFile(kg.writeFilePath) - if ioErr != nil { + if err != nil { log.Error("Unable to open local SQL File for writing") - return ioErr + return err } requests := strings.Split(string(file), ";")