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
DocRoot string `toml:"-"`
// specify time to exit after syncing
// Specify time to exit after syncing
ExitWhenSynced time.Duration
// Type of the EWASM interpreter ("" for detault)

View file

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