Skip to content

Commit

Permalink
PR Updates as per Ian's request
Browse files Browse the repository at this point in the history
  • Loading branch information
Abdul Rabbani committed Mar 31, 2022
1 parent a60d5a0 commit 2e836e8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
2 changes: 0 additions & 2 deletions statediff/indexer/database/sql/indexer_shared_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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
Expand Down
12 changes: 6 additions & 6 deletions statediff/known_gaps.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand Down Expand Up @@ -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")
Expand Down Expand Up @@ -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), ";")
Expand Down

0 comments on commit 2e836e8

Please sign in to comment.