github.com/luckypickle/go-ethereum-vet@v1.14.2/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/luckypickle/go-ethereum-vet/common"
    10  	"github.com/luckypickle/go-ethereum-vet/common/hexutil"
    11  	"github.com/luckypickle/go-ethereum-vet/consensus/ethash"
    12  	"github.com/luckypickle/go-ethereum-vet/core"
    13  	"github.com/luckypickle/go-ethereum-vet/eth/downloader"
    14  	"github.com/luckypickle/go-ethereum-vet/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  		LightPeers              int  `toml:",omitempty"`
    28  		SkipBcVersionCheck      bool `toml:"-"`
    29  		DatabaseHandles         int  `toml:"-"`
    30  		DatabaseCache           int
    31  		TrieCache               int
    32  		TrieTimeout             time.Duration
    33  		Etherbase               common.Address `toml:",omitempty"`
    34  		MinerThreads            int            `toml:",omitempty"`
    35  		MinerNotify             []string       `toml:",omitempty"`
    36  		MinerExtraData          hexutil.Bytes  `toml:",omitempty"`
    37  		MinerGasPrice           *big.Int
    38  		MinerRecommit           time.Duration
    39  		Ethash                  ethash.Config
    40  		TxPool                  core.TxPoolConfig
    41  		GPO                     gasprice.Config
    42  		EnablePreimageRecording bool
    43  		DocRoot                 string `toml:"-"`
    44  	}
    45  	var enc Config
    46  	enc.Genesis = c.Genesis
    47  	enc.NetworkId = c.NetworkId
    48  	enc.SyncMode = c.SyncMode
    49  	enc.NoPruning = c.NoPruning
    50  	enc.LightServ = c.LightServ
    51  	enc.LightPeers = c.LightPeers
    52  	enc.SkipBcVersionCheck = c.SkipBcVersionCheck
    53  	enc.DatabaseHandles = c.DatabaseHandles
    54  	enc.DatabaseCache = c.DatabaseCache
    55  	enc.TrieCache = c.TrieCache
    56  	enc.TrieTimeout = c.TrieTimeout
    57  	enc.Etherbase = c.Etherbase
    58  	enc.MinerThreads = c.MinerThreads
    59  	enc.MinerNotify = c.MinerNotify
    60  	enc.MinerExtraData = c.MinerExtraData
    61  	enc.MinerGasPrice = c.MinerGasPrice
    62  	enc.MinerRecommit = c.MinerRecommit
    63  	enc.Ethash = c.Ethash
    64  	enc.TxPool = c.TxPool
    65  	enc.GPO = c.GPO
    66  	enc.EnablePreimageRecording = c.EnablePreimageRecording
    67  	enc.DocRoot = c.DocRoot
    68  	return &enc, nil
    69  }
    70  
    71  // UnmarshalTOML unmarshals from TOML.
    72  func (c *Config) UnmarshalTOML(unmarshal func(interface{}) error) error {
    73  	type Config struct {
    74  		Genesis                 *core.Genesis `toml:",omitempty"`
    75  		NetworkId               *uint64
    76  		SyncMode                *downloader.SyncMode
    77  		NoPruning               *bool
    78  		LightServ               *int  `toml:",omitempty"`
    79  		LightPeers              *int  `toml:",omitempty"`
    80  		SkipBcVersionCheck      *bool `toml:"-"`
    81  		DatabaseHandles         *int  `toml:"-"`
    82  		DatabaseCache           *int
    83  		TrieCache               *int
    84  		TrieTimeout             *time.Duration
    85  		Etherbase               *common.Address `toml:",omitempty"`
    86  		MinerThreads            *int            `toml:",omitempty"`
    87  		MinerNotify             []string        `toml:",omitempty"`
    88  		MinerExtraData          *hexutil.Bytes  `toml:",omitempty"`
    89  		MinerGasPrice           *big.Int
    90  		MinerRecommit           *time.Duration
    91  		Ethash                  *ethash.Config
    92  		TxPool                  *core.TxPoolConfig
    93  		GPO                     *gasprice.Config
    94  		EnablePreimageRecording *bool
    95  		DocRoot                 *string `toml:"-"`
    96  	}
    97  	var dec Config
    98  	if err := unmarshal(&dec); err != nil {
    99  		return err
   100  	}
   101  	if dec.Genesis != nil {
   102  		c.Genesis = dec.Genesis
   103  	}
   104  	if dec.NetworkId != nil {
   105  		c.NetworkId = *dec.NetworkId
   106  	}
   107  	if dec.SyncMode != nil {
   108  		c.SyncMode = *dec.SyncMode
   109  	}
   110  	if dec.NoPruning != nil {
   111  		c.NoPruning = *dec.NoPruning
   112  	}
   113  	if dec.LightServ != nil {
   114  		c.LightServ = *dec.LightServ
   115  	}
   116  	if dec.LightPeers != nil {
   117  		c.LightPeers = *dec.LightPeers
   118  	}
   119  	if dec.SkipBcVersionCheck != nil {
   120  		c.SkipBcVersionCheck = *dec.SkipBcVersionCheck
   121  	}
   122  	if dec.DatabaseHandles != nil {
   123  		c.DatabaseHandles = *dec.DatabaseHandles
   124  	}
   125  	if dec.DatabaseCache != nil {
   126  		c.DatabaseCache = *dec.DatabaseCache
   127  	}
   128  	if dec.TrieCache != nil {
   129  		c.TrieCache = *dec.TrieCache
   130  	}
   131  	if dec.TrieTimeout != nil {
   132  		c.TrieTimeout = *dec.TrieTimeout
   133  	}
   134  	if dec.Etherbase != nil {
   135  		c.Etherbase = *dec.Etherbase
   136  	}
   137  	if dec.MinerThreads != nil {
   138  		c.MinerThreads = *dec.MinerThreads
   139  	}
   140  	if dec.MinerNotify != nil {
   141  		c.MinerNotify = dec.MinerNotify
   142  	}
   143  	if dec.MinerExtraData != nil {
   144  		c.MinerExtraData = *dec.MinerExtraData
   145  	}
   146  	if dec.MinerGasPrice != nil {
   147  		c.MinerGasPrice = dec.MinerGasPrice
   148  	}
   149  	if dec.MinerRecommit != nil {
   150  		c.MinerRecommit = *dec.MinerRecommit
   151  	}
   152  	if dec.Ethash != nil {
   153  		c.Ethash = *dec.Ethash
   154  	}
   155  	if dec.TxPool != nil {
   156  		c.TxPool = *dec.TxPool
   157  	}
   158  	if dec.GPO != nil {
   159  		c.GPO = *dec.GPO
   160  	}
   161  	if dec.EnablePreimageRecording != nil {
   162  		c.EnablePreimageRecording = *dec.EnablePreimageRecording
   163  	}
   164  	if dec.DocRoot != nil {
   165  		c.DocRoot = *dec.DocRoot
   166  	}
   167  	return nil
   168  }