Linter appeasements to achieve perfection

This commit is contained in:
Michael Shaw 2022-07-28 13:57:44 -04:00
parent f235c6d072
commit 2cea7024b4
5 changed files with 8 additions and 12 deletions

View File

@ -21,6 +21,14 @@ import (
"context" "context"
"errors" "errors"
"fmt" "fmt"
"math/big"
"os"
"reflect"
"time"
"unicode"
"github.com/urfave/cli/v2"
"github.com/ethereum/go-ethereum/accounts/external" "github.com/ethereum/go-ethereum/accounts/external"
"github.com/ethereum/go-ethereum/accounts/keystore" "github.com/ethereum/go-ethereum/accounts/keystore"
"github.com/ethereum/go-ethereum/accounts/scwallet" "github.com/ethereum/go-ethereum/accounts/scwallet"
@ -41,12 +49,6 @@ import (
"github.com/ethereum/go-ethereum/statediff/indexer/interfaces" "github.com/ethereum/go-ethereum/statediff/indexer/interfaces"
"github.com/ethereum/go-ethereum/statediff/indexer/shared" "github.com/ethereum/go-ethereum/statediff/indexer/shared"
"github.com/naoina/toml" "github.com/naoina/toml"
"github.com/urfave/cli/v2"
"math/big"
"os"
"reflect"
"time"
"unicode"
) )
var ( var (

View File

@ -187,7 +187,6 @@ func TestEthTxResolve(t *testing.T) {
t.Fatalf("error should be nil %v", gc) t.Fatalf("error should be nil %v", gc)
} }
} }
} }
func TestEthTxTree(t *testing.T) { func TestEthTxTree(t *testing.T) {

View File

@ -224,7 +224,6 @@ func TestTxTrieResolveBranch(t *testing.T) {
if err != nil { if err != nil {
t.Fatal("Error should be nil") t.Fatal("Error should be nil")
} }
} }
} }

View File

@ -139,7 +139,6 @@ func (kg *KnownGapsState) captureErrorBlocks(knownErrorBlocks []*big.Int) {
log.Warn("The following Gaps were found", "knownErrorBlocks", knownErrorBlocks) log.Warn("The following Gaps were found", "knownErrorBlocks", knownErrorBlocks)
log.Warn("Updating known Gaps table", "startErrorBlock", startErrorBlock, "endErrorBlock", endErrorBlock, "processingKey", kg.processingKey) log.Warn("Updating known Gaps table", "startErrorBlock", startErrorBlock, "endErrorBlock", endErrorBlock, "processingKey", kg.processingKey)
kg.pushKnownGaps(startErrorBlock, endErrorBlock, false, kg.processingKey) kg.pushKnownGaps(startErrorBlock, endErrorBlock, false, kg.processingKey)
} }
// Users provide the latestBlockInDb and the latestBlockOnChain // Users provide the latestBlockInDb and the latestBlockOnChain
@ -153,7 +152,6 @@ func isGap(latestBlockInDb *big.Int, latestBlockOnChain *big.Int, expectedDiffer
return true return true
} }
return false return false
} }
// This function will check for Gaps and update the DB if gaps are found. // This function will check for Gaps and update the DB if gaps are found.

View File

@ -76,7 +76,6 @@ func testWriteToDb(t *testing.T, tests []gapValues, wipeDbBeforeStart bool) {
validateUpsert(t, service, tc.knownErrorBlocksStart, tc.knownErrorBlocksEnd) validateUpsert(t, service, tc.knownErrorBlocksStart, tc.knownErrorBlocksEnd)
} }
tearDown(t, db) tearDown(t, db)
} }
// test writing blocks to file and then inserting them to DB // test writing blocks to file and then inserting them to DB
@ -166,7 +165,6 @@ func testFindAndUpdateGaps(t *testing.T, wipeDbBeforeStart bool) {
startBlock.Add(latestBlockInDb, expectedDifference) startBlock.Add(latestBlockInDb, expectedDifference)
endBlock.Sub(latestBlockOnChain, expectedDifference) endBlock.Sub(latestBlockOnChain, expectedDifference)
validateUpsert(t, service, startBlock.Int64(), endBlock.Int64()) validateUpsert(t, service, startBlock.Int64(), endBlock.Int64())
} }
// test capturing missed blocks // test capturing missed blocks