mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-19 10:22:23 +00:00
62 lines
1.4 KiB
Go
62 lines
1.4 KiB
Go
// Code generated by github.com/fjl/gencodec. DO NOT EDIT.
|
|
|
|
package miner
|
|
|
|
import (
|
|
"math/big"
|
|
"time"
|
|
|
|
"github.com/ethereum/go-ethereum/common"
|
|
"github.com/ethereum/go-ethereum/common/hexutil"
|
|
)
|
|
|
|
var _ = (*configMarshaling)(nil)
|
|
|
|
// MarshalTOML marshals as TOML.
|
|
func (c Config) MarshalTOML() (interface{}, error) {
|
|
type Config struct {
|
|
Etherbase common.Address `toml:",omitempty"`
|
|
Notify []string `toml:",omitempty"`
|
|
ExtraData hexutil.Bytes `toml:",omitempty"`
|
|
GasPrice *big.Int
|
|
Recommit time.Duration
|
|
}
|
|
var enc Config
|
|
enc.Etherbase = c.Etherbase
|
|
enc.Notify = c.Notify
|
|
enc.ExtraData = c.ExtraData
|
|
enc.GasPrice = c.GasPrice
|
|
enc.Recommit = c.Recommit
|
|
return &enc, nil
|
|
}
|
|
|
|
// UnmarshalTOML unmarshals from TOML.
|
|
func (c *Config) UnmarshalTOML(unmarshal func(interface{}) error) error {
|
|
type Config struct {
|
|
Etherbase *common.Address `toml:",omitempty"`
|
|
Notify []string `toml:",omitempty"`
|
|
ExtraData *hexutil.Bytes `toml:",omitempty"`
|
|
GasPrice *big.Int
|
|
Recommit *time.Duration
|
|
}
|
|
var dec Config
|
|
if err := unmarshal(&dec); err != nil {
|
|
return err
|
|
}
|
|
if dec.Etherbase != nil {
|
|
c.Etherbase = *dec.Etherbase
|
|
}
|
|
if dec.Notify != nil {
|
|
c.Notify = dec.Notify
|
|
}
|
|
if dec.ExtraData != nil {
|
|
c.ExtraData = *dec.ExtraData
|
|
}
|
|
if dec.GasPrice != nil {
|
|
c.GasPrice = dec.GasPrice
|
|
}
|
|
if dec.Recommit != nil {
|
|
c.Recommit = *dec.Recommit
|
|
}
|
|
return nil
|
|
}
|