github.com/daeglee/go-ethereum@v0.0.0-20190504220456-cad3e8d18e9b/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  	"time"
     8  
     9  	"github.com/ethereum/go-ethereum/common"
    10  	"github.com/ethereum/go-ethereum/common/hexutil"
    11  	"github.com/ethereum/go-ethereum/consensus/ethash"
    12  	"github.com/ethereum/go-ethereum/core"
    13  	"github.com/ethereum/go-ethereum/eth/downloader"
    14  	"github.com/ethereum/go-ethereum/eth/gasprice"
    15  )
    16  
    17  var _ = (*configMarshaling)(nil)
    18  
    19  // MarshalTOML marshals as TOML.
    20  func (c Config) MarshalTOML() (interface{}, error) {
    21  	type Config struct {
    22  		Genesis                 *core.Genesis `toml:",omitempty"`
    23  		NetworkId               uint64
    24  		SyncMode                downloader.SyncMode
    25  		NoPruning               bool
    26  		LightServ               int `toml:",omitempty"`
    27  		LightBandwidthIn        int `toml:",omitempty"`
    28  		LightBandwidthOut       int `toml:",omitempty"`
    29  		LightPeers              int `toml:",omitempty"`
    30  		OnlyAnnounce            bool
    31  		ULC                     *ULCConfig `toml:",omitempty"`
    32  		SkipBcVersionCheck      bool       `toml:"-"`
    33  		DatabaseHandles         int        `toml:"-"`
    34  		DatabaseCache           int
    35  		TrieCleanCache          int
    36  		TrieDirtyCache          int
    37  		TrieTimeout             time.Duration
    38  		Etherbase               common.Address `toml:",omitempty"`
    39  		MinerNotify             []string       `toml:",omitempty"`
    40  		MinerExtraData          hexutil.Bytes  `toml:",omitempty"`
    41  		MinerGasFloor           uint64
    42  		MinerGasCeil            uint64
    43  		MinerGasPrice           *big.Int
    44  		MinerRecommit           time.Duration
    45  		MinerNoverify           bool
    46  		Ethash                  ethash.Config
    47  		TxPool                  core.TxPoolConfig
    48  		GPO                     gasprice.Config
    49  		EnablePreimageRecording bool
    50  		DocRoot                 string `toml:"-"`
    51  		EWASMInterpreter        string
    52  		EVMInterpreter          string
    53  	}
    54  	var enc Config
    55  	enc.Genesis = c.Genesis
    56  	enc.NetworkId = c.NetworkId
    57  	enc.SyncMode = c.SyncMode
    58  	enc.NoPruning = c.NoPruning
    59  	enc.LightServ = c.LightServ
    60  	enc.LightBandwidthIn = c.LightBandwidthIn
    61  	enc.LightBandwidthOut = c.LightBandwidthOut
    62  	enc.LightPeers = c.LightPeers
    63  	enc.OnlyAnnounce = c.OnlyAnnounce
    64  	enc.ULC = c.ULC
    65  	enc.SkipBcVersionCheck = c.SkipBcVersionCheck
    66  	enc.DatabaseHandles = c.DatabaseHandles
    67  	enc.DatabaseCache = c.DatabaseCache
    68  	enc.TrieCleanCache = c.TrieCleanCache
    69  	enc.TrieDirtyCache = c.TrieDirtyCache
    70  	enc.TrieTimeout = c.TrieTimeout
    71  	enc.Etherbase = c.Etherbase
    72  	enc.MinerNotify = c.MinerNotify
    73  	enc.MinerExtraData = c.MinerExtraData
    74  	enc.MinerGasFloor = c.MinerGasFloor
    75  	enc.MinerGasCeil = c.MinerGasCeil
    76  	enc.MinerGasPrice = c.MinerGasPrice
    77  	enc.MinerRecommit = c.MinerRecommit
    78  	enc.MinerNoverify = c.MinerNoverify
    79  	enc.Ethash = c.Ethash
    80  	enc.TxPool = c.TxPool
    81  	enc.GPO = c.GPO
    82  
    83  	enc.EnablePreimageRecording = c.EnablePreimageRecording
    84  	enc.DocRoot = c.DocRoot
    85  	enc.EWASMInterpreter = c.EWASMInterpreter
    86  	enc.EVMInterpreter = c.EVMInterpreter
    87  	return &enc, nil
    88  }
    89  
    90  // UnmarshalTOML unmarshals from TOML.
    91  func (c *Config) UnmarshalTOML(unmarshal func(interface{}) error) error {
    92  	type Config struct {
    93  		Genesis                 *core.Genesis `toml:",omitempty"`
    94  		NetworkId               *uint64
    95  		SyncMode                *downloader.SyncMode
    96  		NoPruning               *bool
    97  		LightServ               *int `toml:",omitempty"`
    98  		LightBandwidthIn        *int `toml:",omitempty"`
    99  		LightBandwidthOut       *int `toml:",omitempty"`
   100  		LightPeers              *int `toml:",omitempty"`
   101  		OnlyAnnounce            *bool
   102  		ULC                     *ULCConfig `toml:",omitempty"`
   103  		SkipBcVersionCheck      *bool      `toml:"-"`
   104  		DatabaseHandles         *int       `toml:"-"`
   105  		DatabaseCache           *int
   106  		TrieCleanCache          *int
   107  		TrieDirtyCache          *int
   108  		TrieTimeout             *time.Duration
   109  		Etherbase               *common.Address `toml:",omitempty"`
   110  		MinerNotify             []string        `toml:",omitempty"`
   111  		MinerExtraData          *hexutil.Bytes  `toml:",omitempty"`
   112  		MinerGasFloor           *uint64
   113  		MinerGasCeil            *uint64
   114  		MinerGasPrice           *big.Int
   115  		MinerRecommit           *time.Duration
   116  		MinerNoverify           *bool
   117  		Ethash                  *ethash.Config
   118  		TxPool                  *core.TxPoolConfig
   119  		GPO                     *gasprice.Config
   120  		EnablePreimageRecording *bool
   121  		DocRoot                 *string `toml:"-"`
   122  		EWASMInterpreter        *string
   123  		EVMInterpreter          *string
   124  	}
   125  	var dec Config
   126  	if err := unmarshal(&dec); err != nil {
   127  		return err
   128  	}
   129  	if dec.Genesis != nil {
   130  		c.Genesis = dec.Genesis
   131  	}
   132  	if dec.NetworkId != nil {
   133  		c.NetworkId = *dec.NetworkId
   134  	}
   135  	if dec.SyncMode != nil {
   136  		c.SyncMode = *dec.SyncMode
   137  	}
   138  	if dec.NoPruning != nil {
   139  		c.NoPruning = *dec.NoPruning
   140  	}
   141  	if dec.LightServ != nil {
   142  		c.LightServ = *dec.LightServ
   143  	}
   144  	if dec.LightBandwidthIn != nil {
   145  		c.LightBandwidthIn = *dec.LightBandwidthIn
   146  	}
   147  	if dec.LightBandwidthOut != nil {
   148  		c.LightBandwidthOut = *dec.LightBandwidthOut
   149  	}
   150  	if dec.LightPeers != nil {
   151  		c.LightPeers = *dec.LightPeers
   152  	}
   153  	if dec.OnlyAnnounce != nil {
   154  		c.OnlyAnnounce = *dec.OnlyAnnounce
   155  	}
   156  	if dec.ULC != nil {
   157  		c.ULC = dec.ULC
   158  	}
   159  	if dec.SkipBcVersionCheck != nil {
   160  		c.SkipBcVersionCheck = *dec.SkipBcVersionCheck
   161  	}
   162  	if dec.DatabaseHandles != nil {
   163  		c.DatabaseHandles = *dec.DatabaseHandles
   164  	}
   165  	if dec.DatabaseCache != nil {
   166  		c.DatabaseCache = *dec.DatabaseCache
   167  	}
   168  	if dec.TrieCleanCache != nil {
   169  		c.TrieCleanCache = *dec.TrieCleanCache
   170  	}
   171  	if dec.TrieDirtyCache != nil {
   172  		c.TrieDirtyCache = *dec.TrieDirtyCache
   173  	}
   174  	if dec.TrieTimeout != nil {
   175  		c.TrieTimeout = *dec.TrieTimeout
   176  	}
   177  	if dec.Etherbase != nil {
   178  		c.Etherbase = *dec.Etherbase
   179  	}
   180  	if dec.MinerNotify != nil {
   181  		c.MinerNotify = dec.MinerNotify
   182  	}
   183  	if dec.MinerExtraData != nil {
   184  		c.MinerExtraData = *dec.MinerExtraData
   185  	}
   186  	if dec.MinerGasFloor != nil {
   187  		c.MinerGasFloor = *dec.MinerGasFloor
   188  	}
   189  	if dec.MinerGasCeil != nil {
   190  		c.MinerGasCeil = *dec.MinerGasCeil
   191  	}
   192  	if dec.MinerGasPrice != nil {
   193  		c.MinerGasPrice = dec.MinerGasPrice
   194  	}
   195  	if dec.MinerRecommit != nil {
   196  		c.MinerRecommit = *dec.MinerRecommit
   197  	}
   198  	if dec.MinerNoverify != nil {
   199  		c.MinerNoverify = *dec.MinerNoverify
   200  	}
   201  	if dec.Ethash != nil {
   202  		c.Ethash = *dec.Ethash
   203  	}
   204  	if dec.TxPool != nil {
   205  		c.TxPool = *dec.TxPool
   206  	}
   207  	if dec.GPO != nil {
   208  		c.GPO = *dec.GPO
   209  	}
   210  	if dec.EnablePreimageRecording != nil {
   211  		c.EnablePreimageRecording = *dec.EnablePreimageRecording
   212  	}
   213  	if dec.DocRoot != nil {
   214  		c.DocRoot = *dec.DocRoot
   215  	}
   216  	if dec.EWASMInterpreter != nil {
   217  		c.EWASMInterpreter = *dec.EWASMInterpreter
   218  	}
   219  	if dec.EVMInterpreter != nil {
   220  		c.EVMInterpreter = *dec.EVMInterpreter
   221  	}
   222  	return nil
   223  }