params: clarify consensus engine config `String`s (#29643)

Define these on a value receiever so that nil is shown differently.
This commit is contained in:
Roy Crihfield 2024-04-28 19:03:03 +08:00 committed by GitHub
parent 4253030ef6
commit 4bdbaab471
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 3 deletions

View File

@ -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.