mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 02:42:27 +00:00
params: fix consensus config string representations
These should at least indicate whether the object is nil.
This commit is contained in:
parent
ade7515c81
commit
7b25fd0b27
1 changed files with 7 additions and 1 deletions
|
|
@ -375,6 +375,9 @@ type EthashConfig struct{}
|
||||||
|
|
||||||
// String implements the stringer interface, returning the consensus engine details.
|
// String implements the stringer interface, returning the consensus engine details.
|
||||||
func (c *EthashConfig) String() string {
|
func (c *EthashConfig) String() string {
|
||||||
|
if c == nil {
|
||||||
|
return "<nil>"
|
||||||
|
}
|
||||||
return "ethash"
|
return "ethash"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -386,7 +389,10 @@ type CliqueConfig struct {
|
||||||
|
|
||||||
// String implements the stringer interface, returning the consensus engine details.
|
// String implements the stringer interface, returning the consensus engine details.
|
||||||
func (c *CliqueConfig) String() string {
|
func (c *CliqueConfig) String() string {
|
||||||
return "clique"
|
if c == nil {
|
||||||
|
return "<nil>"
|
||||||
|
}
|
||||||
|
return fmt.Sprintf("Clique { Period: %d, Epoch: %d }", c.Period, c.Epoch)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Description returns a human-readable description of ChainConfig.
|
// Description returns a human-readable description of ChainConfig.
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue