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