eth: Fixed styling and gen_config

This commit is contained in:
Lucas Hendren 2018-10-17 00:32:01 -04:00
parent 832035636b
commit 5cec18b24a
2 changed files with 7 additions and 1 deletions

View file

@ -122,7 +122,7 @@ type Config struct {
// Miscellaneous options // Miscellaneous options
DocRoot string `toml:"-"` DocRoot string `toml:"-"`
// specify time to exit after syncing // Specify time to exit after syncing
ExitWhenSynced time.Duration ExitWhenSynced time.Duration
// Type of the EWASM interpreter ("" for detault) // Type of the EWASM interpreter ("" for detault)

View file

@ -43,6 +43,7 @@ func (c Config) MarshalTOML() (interface{}, error) {
GPO gasprice.Config GPO gasprice.Config
EnablePreimageRecording bool EnablePreimageRecording bool
DocRoot string `toml:"-"` DocRoot string `toml:"-"`
ExitWhenSynced time.Duration
} }
var enc Config var enc Config
enc.Genesis = c.Genesis enc.Genesis = c.Genesis
@ -69,6 +70,7 @@ func (c Config) MarshalTOML() (interface{}, error) {
enc.GPO = c.GPO enc.GPO = c.GPO
enc.EnablePreimageRecording = c.EnablePreimageRecording enc.EnablePreimageRecording = c.EnablePreimageRecording
enc.DocRoot = c.DocRoot enc.DocRoot = c.DocRoot
enc.ExitWhenSynced = c.ExitWhenSynced
return &enc, nil return &enc, nil
} }
@ -99,6 +101,7 @@ func (c *Config) UnmarshalTOML(unmarshal func(interface{}) error) error {
GPO *gasprice.Config GPO *gasprice.Config
EnablePreimageRecording *bool EnablePreimageRecording *bool
DocRoot *string `toml:"-"` DocRoot *string `toml:"-"`
ExitWhenSynced time.Duration
} }
var dec Config var dec Config
if err := unmarshal(&dec); err != nil { if err := unmarshal(&dec); err != nil {
@ -176,5 +179,8 @@ func (c *Config) UnmarshalTOML(unmarshal func(interface{}) error) error {
if dec.DocRoot != nil { if dec.DocRoot != nil {
c.DocRoot = *dec.DocRoot c.DocRoot = *dec.DocRoot
} }
if dec.ExitWhenSynced != nil {
c.ExitWhenSynced = *dec.ExitWhenSynced
}
return nil return nil
} }