Skip to content

Commit

Permalink
Comment simplified for MarshalChainConfigJSON
Browse files Browse the repository at this point in the history
  • Loading branch information
qdm12 committed Jan 6, 2025
1 parent 1000eb1 commit 0d359a8
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions params/json.libevm.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,9 @@ func (c *ChainConfig) MarshalJSON() ([]byte, error) {
return MarshalChainConfigJSON(*c, c.extra, ec.reuseJSONRoot)
}

// MarshalChainConfigJSON JSON encodes `config` and `extra` according to the following.
// - `reuseJSONRoot` is false:
// `config` is encoded with `extra` encoded at the "extra" JSON field.
// - `reuseJSONRoot` is true:
// `config` is encoded with `extra` encoded at the root depth of the JSON object.
// MarshalChainConfigJSON is equivalent to [ChainConfig.MarshalJSON]
// had [Extras] with `C` been registered, but without the need to
// call [RegisterExtras].
func MarshalChainConfigJSON[C any](config ChainConfig, extra C, reuseJSONRoot bool) (data []byte, err error) {
if !reuseJSONRoot {
jsonExtra := struct {
Expand Down

0 comments on commit 0d359a8

Please sign in to comment.