github.com/n1ghtfa1l/go-vnt@v0.6.4-alpha.6/vnt/gen_config.go (about)

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