PR Updates as per Ian's request
This commit is contained in:
parent
a60d5a016d
commit
2e836e869a
@ -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
|
||||
|
@ -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), ";")
|
||||
|
Loading…
Reference in New Issue
Block a user