github.com/xfond/eth-implementation@v1.8.9-0.20180514135602-f6bc65fc6811/eth/gen_config.go (about)

     1  // Code generated by github.com/fjl/gencodec. DO NOT EDIT.
     2  
     3  package eth
     4  
     5  import (
     6  	"math/big"
     7  
     8  	"github.com/ethereum/go-ethereum/common"
     9  	"github.com/ethereum/go-ethereum/common/hexutil"
    10  	"github.com/ethereum/go-ethereum/consensus/ethash"
    11  	"github.com/ethereum/go-ethereum/core"
    12  	"github.com/ethereum/go-ethereum/eth/downloader"
    13  	"github.com/ethereum/go-ethereum/eth/gasprice"
    14  )
    15  
    16  var _ = (*configMarshaling)(nil)
    17  
    18  func (c Config) MarshalTOML() (interface{}, error) {
    19  	type Config struct {
    20  		Genesis                 *core.Genesis `toml:",omitempty"`
    21  		NetworkId               uint64
    22  		SyncMode                downloader.SyncMode
    23  		LightServ               int  `toml:",omitempty"`
    24  		LightPeers              int  `toml:",omitempty"`
    25  		SkipBcVersionCheck      bool `toml:"-"`
    26  		DatabaseHandles         int  `toml:"-"`
    27  		DatabaseCache           int
    28  		Etherbase               common.Address `toml:",omitempty"`
    29  		MinerThreads            int            `toml:",omitempty"`
    30  		ExtraData               hexutil.Bytes  `toml:",omitempty"`
    31  		GasPrice                *big.Int
    32  		Ethash                  ethash.Config
    33  		TxPool                  core.TxPoolConfig
    34  		GPO                     gasprice.Config
    35  		EnablePreimageRecording bool
    36  		DocRoot                 string `toml:"-"`
    37  	}
    38  	var enc Config
    39  	enc.Genesis = c.Genesis
    40  	enc.NetworkId = c.NetworkId
    41  	enc.SyncMode = c.SyncMode
    42  	enc.LightServ = c.LightServ
    43  	enc.LightPeers = c.LightPeers
    44  	enc.SkipBcVersionCheck = c.SkipBcVersionCheck
    45  	enc.DatabaseHandles = c.DatabaseHandles
    46  	enc.DatabaseCache = c.DatabaseCache
    47  	enc.Etherbase = c.Etherbase
    48  	enc.MinerThreads = c.MinerThreads
    49  	enc.ExtraData = c.ExtraData
    50  	enc.GasPrice = c.GasPrice
    51  	enc.Ethash = c.Ethash
    52  	enc.TxPool = c.TxPool
    53  	enc.GPO = c.GPO
    54  	enc.EnablePreimageRecording = c.EnablePreimageRecording
    55  	enc.DocRoot = c.DocRoot
    56  	return &enc, nil
    57  }
    58  
    59  func (c *Config) UnmarshalTOML(unmarshal func(interface{}) error) error {
    60  	type Config struct {
    61  		Genesis                 *core.Genesis `toml:",omitempty"`
    62  		NetworkId               *uint64
    63  		SyncMode                *downloader.SyncMode
    64  		LightServ               *int  `toml:",omitempty"`
    65  		LightPeers              *int  `toml:",omitempty"`
    66  		SkipBcVersionCheck      *bool `toml:"-"`
    67  		DatabaseHandles         *int  `toml:"-"`
    68  		DatabaseCache           *int
    69  		Etherbase               *common.Address `toml:",omitempty"`
    70  		MinerThreads            *int            `toml:",omitempty"`
    71  		ExtraData               *hexutil.Bytes  `toml:",omitempty"`
    72  		GasPrice                *big.Int
    73  		Ethash                  *ethash.Config
    74  		TxPool                  *core.TxPoolConfig
    75  		GPO                     *gasprice.Config
    76  		EnablePreimageRecording *bool
    77  		DocRoot                 *string `toml:"-"`
    78  	}
    79  	var dec Config
    80  	if err := unmarshal(&dec); err != nil {
    81  		return err
    82  	}
    83  	if dec.Genesis != nil {
    84  		c.Genesis = dec.Genesis
    85  	}
    86  	if dec.NetworkId != nil {
    87  		c.NetworkId = *dec.NetworkId
    88  	}
    89  	if dec.SyncMode != nil {
    90  		c.SyncMode = *dec.SyncMode
    91  	}
    92  	if dec.LightServ != nil {
    93  		c.LightServ = *dec.LightServ
    94  	}
    95  	if dec.LightPeers != nil {
    96  		c.LightPeers = *dec.LightPeers
    97  	}
    98  	if dec.SkipBcVersionCheck != nil {
    99  		c.SkipBcVersionCheck = *dec.SkipBcVersionCheck
   100  	}
   101  	if dec.DatabaseHandles != nil {
   102  		c.DatabaseHandles = *dec.DatabaseHandles
   103  	}
   104  	if dec.DatabaseCache != nil {
   105  		c.DatabaseCache = *dec.DatabaseCache
   106  	}
   107  	if dec.Etherbase != nil {
   108  		c.Etherbase = *dec.Etherbase
   109  	}
   110  	if dec.MinerThreads != nil {
   111  		c.MinerThreads = *dec.MinerThreads
   112  	}
   113  	if dec.ExtraData != nil {
   114  		c.ExtraData = *dec.ExtraData
   115  	}
   116  	if dec.GasPrice != nil {
   117  		c.GasPrice = dec.GasPrice
   118  	}
   119  	if dec.Ethash != nil {
   120  		c.Ethash = *dec.Ethash
   121  	}
   122  	if dec.TxPool != nil {
   123  		c.TxPool = *dec.TxPool
   124  	}
   125  	if dec.GPO != nil {
   126  		c.GPO = *dec.GPO
   127  	}
   128  	if dec.EnablePreimageRecording != nil {
   129  		c.EnablePreimageRecording = *dec.EnablePreimageRecording
   130  	}
   131  	if dec.DocRoot != nil {
   132  		c.DocRoot = *dec.DocRoot
   133  	}
   134  	return nil
   135  }