diff --git a/core/state_processor_test.go b/core/state_processor_test.go index fdc52281a5..fed9e18b0f 100644 --- a/core/state_processor_test.go +++ b/core/state_processor_test.go @@ -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 diff --git a/eth/protocols/eth/handler_test.go b/eth/protocols/eth/handler_test.go index 5d9ee809e3..ca9f1dbbb3 100644 --- a/eth/protocols/eth/handler_test.go +++ b/eth/protocols/eth/handler_test.go @@ -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. diff --git a/params/config.go b/params/config.go index 6172ab63eb..b336537aeb 100644 --- a/params/config.go +++ b/params/config.go @@ -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) @@ -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 { @@ -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) diff --git a/tests/init.go b/tests/init.go index e5f68f683c..f26e60a13b 100644 --- a/tests/init.go +++ b/tests/init.go @@ -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": {