Skip to content

Commit

Permalink
fix linters
Browse files Browse the repository at this point in the history
  • Loading branch information
temaniarpit27 committed Oct 16, 2023
1 parent 109a0a1 commit 01a4c0d
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 63 deletions.
2 changes: 0 additions & 2 deletions core/state_processor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@ import (
"github.com/holiman/uint256"
)

func u64(val uint64) *uint64 { return &val }

// TestStateProcessorErrors tests the output from the 'core' errors
// as defined in core/error.go. These errors are generated when the
// blockchain imports bad blocks, meaning blocks which have valid headers but
Expand Down
2 changes: 0 additions & 2 deletions eth/protocols/eth/handler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,6 @@ var (
testAddr = crypto.PubkeyToAddress(testKey.PublicKey)
)

func u64(val uint64) *uint64 { return &val }

// testBackend is a mock implementation of the live Ethereum message handler. Its
// purpose is to allow testing the request/reply workflows and wire serialization
// in the `eth` protocol without actually doing any data processing.
Expand Down
57 changes: 0 additions & 57 deletions params/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ var (
KilnGenesisHash = common.HexToHash("0x51c7fe41be669f69c45c33a56982cbde405313342d9e2b00d7c91a7b284dd4f8")
)

func newUint64(val uint64) *uint64 { return &val }

var (
MainnetTerminalTotalDifficulty, _ = new(big.Int).SetString("58_750_000_000_000_000_000_000", 0)

Expand Down Expand Up @@ -1085,35 +1083,6 @@ func configBlockEqual(x, y *big.Int) bool {
return x.Cmp(y) == 0
}

// isForkTimestampIncompatible returns true if a fork scheduled at timestamp s1
// cannot be rescheduled to timestamp s2 because head is already past the fork.
func isForkTimestampIncompatible(s1, s2 *uint64, head uint64) bool {
return (isTimestampForked(s1, head) || isTimestampForked(s2, head)) && !configTimestampEqual(s1, s2)
}

// isTimestampForked returns whether a fork scheduled at timestamp s is active
// at the given head timestamp. Whilst this method is the same as isBlockForked,
// they are explicitly separate for clearer reading.
func isTimestampForked(s *uint64, head uint64) bool {
if s == nil {
return false
}

return *s <= head
}

func configTimestampEqual(x, y *uint64) bool {
if x == nil {
return y == nil
}

if y == nil {
return x == nil
}

return *x == *y
}

// ConfigCompatError is raised if the locally-stored blockchain is initialised with a
// ChainConfig that would alter the past.
type ConfigCompatError struct {
Expand Down Expand Up @@ -1157,32 +1126,6 @@ func newBlockCompatError(what string, storedblock, newblock *big.Int) *ConfigCom
return err
}

func newTimestampCompatError(what string, storedtime, newtime *uint64) *ConfigCompatError {
var rew *uint64

switch {
case storedtime == nil:
rew = newtime
case newtime == nil || *storedtime < *newtime:
rew = storedtime
default:
rew = newtime
}

err := &ConfigCompatError{
What: what,
StoredTime: storedtime,
NewTime: newtime,
RewindToTime: 0,
}

if rew != nil {
err.RewindToTime = *rew - 1
}

return err
}

func (err *ConfigCompatError) Error() string {
if err.StoredBlock != nil {
return fmt.Sprintf("mismatching %s in database (have block %d, want block %d, rewindto block %d)", err.What, err.StoredBlock, err.NewBlock, err.RewindToBlock)
Expand Down
2 changes: 0 additions & 2 deletions tests/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ import (
"github.com/ethereum/go-ethereum/params"
)

func u64(val uint64) *uint64 { return &val }

// Forks table defines supported forks and their chain config.
var Forks = map[string]*params.ChainConfig{
"Frontier": {
Expand Down

0 comments on commit 01a4c0d

Please sign in to comment.