mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-26 06:36:43 +00:00
fix linters
This commit is contained in:
parent
109a0a19a6
commit
01a4c0d026
4 changed files with 0 additions and 63 deletions
|
|
@ -39,8 +39,6 @@ import (
|
||||||
"github.com/holiman/uint256"
|
"github.com/holiman/uint256"
|
||||||
)
|
)
|
||||||
|
|
||||||
func u64(val uint64) *uint64 { return &val }
|
|
||||||
|
|
||||||
// TestStateProcessorErrors tests the output from the 'core' errors
|
// TestStateProcessorErrors tests the output from the 'core' errors
|
||||||
// as defined in core/error.go. These errors are generated when the
|
// as defined in core/error.go. These errors are generated when the
|
||||||
// blockchain imports bad blocks, meaning blocks which have valid headers but
|
// blockchain imports bad blocks, meaning blocks which have valid headers but
|
||||||
|
|
|
||||||
|
|
@ -48,8 +48,6 @@ var (
|
||||||
testAddr = crypto.PubkeyToAddress(testKey.PublicKey)
|
testAddr = crypto.PubkeyToAddress(testKey.PublicKey)
|
||||||
)
|
)
|
||||||
|
|
||||||
func u64(val uint64) *uint64 { return &val }
|
|
||||||
|
|
||||||
// testBackend is a mock implementation of the live Ethereum message handler. Its
|
// testBackend is a mock implementation of the live Ethereum message handler. Its
|
||||||
// purpose is to allow testing the request/reply workflows and wire serialization
|
// purpose is to allow testing the request/reply workflows and wire serialization
|
||||||
// in the `eth` protocol without actually doing any data processing.
|
// in the `eth` protocol without actually doing any data processing.
|
||||||
|
|
|
||||||
|
|
@ -36,8 +36,6 @@ var (
|
||||||
KilnGenesisHash = common.HexToHash("0x51c7fe41be669f69c45c33a56982cbde405313342d9e2b00d7c91a7b284dd4f8")
|
KilnGenesisHash = common.HexToHash("0x51c7fe41be669f69c45c33a56982cbde405313342d9e2b00d7c91a7b284dd4f8")
|
||||||
)
|
)
|
||||||
|
|
||||||
func newUint64(val uint64) *uint64 { return &val }
|
|
||||||
|
|
||||||
var (
|
var (
|
||||||
MainnetTerminalTotalDifficulty, _ = new(big.Int).SetString("58_750_000_000_000_000_000_000", 0)
|
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
|
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
|
// ConfigCompatError is raised if the locally-stored blockchain is initialised with a
|
||||||
// ChainConfig that would alter the past.
|
// ChainConfig that would alter the past.
|
||||||
type ConfigCompatError struct {
|
type ConfigCompatError struct {
|
||||||
|
|
@ -1157,32 +1126,6 @@ func newBlockCompatError(what string, storedblock, newblock *big.Int) *ConfigCom
|
||||||
return err
|
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 {
|
func (err *ConfigCompatError) Error() string {
|
||||||
if err.StoredBlock != nil {
|
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)
|
return fmt.Sprintf("mismatching %s in database (have block %d, want block %d, rewindto block %d)", err.What, err.StoredBlock, err.NewBlock, err.RewindToBlock)
|
||||||
|
|
|
||||||
|
|
@ -24,8 +24,6 @@ import (
|
||||||
"github.com/ethereum/go-ethereum/params"
|
"github.com/ethereum/go-ethereum/params"
|
||||||
)
|
)
|
||||||
|
|
||||||
func u64(val uint64) *uint64 { return &val }
|
|
||||||
|
|
||||||
// Forks table defines supported forks and their chain config.
|
// Forks table defines supported forks and their chain config.
|
||||||
var Forks = map[string]*params.ChainConfig{
|
var Forks = map[string]*params.ChainConfig{
|
||||||
"Frontier": {
|
"Frontier": {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue