whisper: remove gencodec override for config

This commit is contained in:
Bas van Kervel 2017-06-21 10:11:35 +02:00
parent 36e7963467
commit 767dc6c73d
2 changed files with 0 additions and 34 deletions

View File

@ -20,8 +20,6 @@ import (
"gopkg.in/urfave/cli.v1"
)
//go:generate gencodec -type Config -formats toml -out gen_config.go
type Config struct {
MaxMessageSize uint32 `toml:",omitempty"`
MinimumAcceptedPOW float64 `toml:",omitempty"`

View File

@ -1,32 +0,0 @@
// Code generated by github.com/fjl/gencodec. DO NOT EDIT.
package whisperv5
func (c Config) MarshalTOML() (interface{}, error) {
type Config struct {
MaxMessageSize uint32 `toml:",omitempty"`
MinimumAcceptedPOW float64 `toml:",omitempty"`
}
var enc Config
enc.MaxMessageSize = c.MaxMessageSize
enc.MinimumAcceptedPOW = c.MinimumAcceptedPOW
return &enc, nil
}
func (c *Config) UnmarshalTOML(unmarshal func(interface{}) error) error {
type Config struct {
MaxMessageSize *uint32 `toml:",omitempty"`
MinimumAcceptedPOW *float64 `toml:",omitempty"`
}
var dec Config
if err := unmarshal(&dec); err != nil {
return err
}
if dec.MaxMessageSize != nil {
c.MaxMessageSize = *dec.MaxMessageSize
}
if dec.MinimumAcceptedPOW != nil {
c.MinimumAcceptedPOW = *dec.MinimumAcceptedPOW
}
return nil
}