From 4bdbaab471d2566c9f267b8372ed18c2af6646ee Mon Sep 17 00:00:00 2001 From: Roy Crihfield Date: Sun, 28 Apr 2024 19:03:03 +0800 Subject: [PATCH] params: clarify consensus engine config `String`s (#29643) Define these on a value receiever so that nil is shown differently. --- params/config.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/params/config.go b/params/config.go index 439e882189240..486cb6d132b14 100644 --- a/params/config.go +++ b/params/config.go @@ -374,7 +374,7 @@ type ChainConfig struct { type EthashConfig struct{} // String implements the stringer interface, returning the consensus engine details. -func (c *EthashConfig) String() string { +func (c EthashConfig) String() string { return "ethash" } @@ -385,8 +385,8 @@ type CliqueConfig struct { } // String implements the stringer interface, returning the consensus engine details. -func (c *CliqueConfig) String() string { - return "clique" +func (c CliqueConfig) String() string { + return fmt.Sprintf("clique(period: %d, epoch: %d)", c.Period, c.Epoch) } // Description returns a human-readable description of ChainConfig.