github.com/pfcoder/quorum@v2.0.3-0.20180501191142-d4a1b0958135+incompatible/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/istanbul"
    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  func (c Config) MarshalTOML() (interface{}, error) {
    17  	type Config struct {
    18  		Genesis                 *core.Genesis `toml:",omitempty"`
    19  		NetworkId               uint64
    20  		SyncMode                downloader.SyncMode
    21  		LightServ               int  `toml:",omitempty"`
    22  		LightPeers              int  `toml:",omitempty"`
    23  		MaxPeers                int  `toml:"-"`
    24  		SkipBcVersionCheck      bool `toml:"-"`
    25  		DatabaseHandles         int  `toml:"-"`
    26  		DatabaseCache           int
    27  		Etherbase               common.Address `toml:",omitempty"`
    28  		MinerThreads            int            `toml:",omitempty"`
    29  		ExtraData               hexutil.Bytes  `toml:",omitempty"`
    30  		GasPrice                *big.Int
    31  		EthashCacheDir          string
    32  		EthashCachesInMem       int
    33  		EthashCachesOnDisk      int
    34  		EthashDatasetDir        string
    35  		EthashDatasetsInMem     int
    36  		EthashDatasetsOnDisk    int
    37  		TxPool                  core.TxPoolConfig
    38  		GPO                     gasprice.Config
    39  		EnablePreimageRecording bool
    40  		Istanbul                istanbul.Config
    41  		DocRoot                 string `toml:"-"`
    42  		PowFake                 bool   `toml:"-"`
    43  		PowTest                 bool   `toml:"-"`
    44  		PowShared               bool   `toml:"-"`
    45  	}
    46  	var enc Config
    47  	enc.Genesis = c.Genesis
    48  	enc.NetworkId = c.NetworkId
    49  	enc.SyncMode = c.SyncMode
    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.Etherbase = c.Etherbase
    56  	enc.MinerThreads = c.MinerThreads
    57  	enc.ExtraData = c.ExtraData
    58  	enc.GasPrice = c.GasPrice
    59  	enc.EthashCacheDir = c.EthashCacheDir
    60  	enc.EthashCachesInMem = c.EthashCachesInMem
    61  	enc.EthashCachesOnDisk = c.EthashCachesOnDisk
    62  	enc.EthashDatasetDir = c.EthashDatasetDir
    63  	enc.EthashDatasetsInMem = c.EthashDatasetsInMem
    64  	enc.EthashDatasetsOnDisk = c.EthashDatasetsOnDisk
    65  	enc.TxPool = c.TxPool
    66  	enc.GPO = c.GPO
    67  	enc.EnablePreimageRecording = c.EnablePreimageRecording
    68  	enc.Istanbul = c.Istanbul
    69  	enc.DocRoot = c.DocRoot
    70  	enc.PowFake = c.PowFake
    71  	enc.PowTest = c.PowTest
    72  	enc.PowShared = c.PowShared
    73  	return &enc, nil
    74  }
    75  
    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  		LightServ               *int  `toml:",omitempty"`
    82  		LightPeers              *int  `toml:",omitempty"`
    83  		MaxPeers                *int  `toml:"-"`
    84  		SkipBcVersionCheck      *bool `toml:"-"`
    85  		DatabaseHandles         *int  `toml:"-"`
    86  		DatabaseCache           *int
    87  		Etherbase               *common.Address `toml:",omitempty"`
    88  		MinerThreads            *int            `toml:",omitempty"`
    89  		ExtraData               hexutil.Bytes   `toml:",omitempty"`
    90  		GasPrice                *big.Int
    91  		EthashCacheDir          *string
    92  		EthashCachesInMem       *int
    93  		EthashCachesOnDisk      *int
    94  		EthashDatasetDir        *string
    95  		EthashDatasetsInMem     *int
    96  		EthashDatasetsOnDisk    *int
    97  		TxPool                  *core.TxPoolConfig
    98  		GPO                     *gasprice.Config
    99  		EnablePreimageRecording *bool
   100  		Istanbul                *istanbul.Config
   101  		DocRoot                 *string `toml:"-"`
   102  		PowFake                 *bool   `toml:"-"`
   103  		PowTest                 *bool   `toml:"-"`
   104  		PowShared               *bool   `toml:"-"`
   105  	}
   106  	var dec Config
   107  	if err := unmarshal(&dec); err != nil {
   108  		return err
   109  	}
   110  	if dec.Genesis != nil {
   111  		c.Genesis = dec.Genesis
   112  	}
   113  	if dec.NetworkId != nil {
   114  		c.NetworkId = *dec.NetworkId
   115  	}
   116  	if dec.SyncMode != nil {
   117  		c.SyncMode = *dec.SyncMode
   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.Etherbase != nil {
   135  		c.Etherbase = *dec.Etherbase
   136  	}
   137  	if dec.MinerThreads != nil {
   138  		c.MinerThreads = *dec.MinerThreads
   139  	}
   140  	if dec.ExtraData != nil {
   141  		c.ExtraData = dec.ExtraData
   142  	}
   143  	if dec.GasPrice != nil {
   144  		c.GasPrice = dec.GasPrice
   145  	}
   146  	if dec.EthashCacheDir != nil {
   147  		c.EthashCacheDir = *dec.EthashCacheDir
   148  	}
   149  	if dec.EthashCachesInMem != nil {
   150  		c.EthashCachesInMem = *dec.EthashCachesInMem
   151  	}
   152  	if dec.EthashCachesOnDisk != nil {
   153  		c.EthashCachesOnDisk = *dec.EthashCachesOnDisk
   154  	}
   155  	if dec.EthashDatasetDir != nil {
   156  		c.EthashDatasetDir = *dec.EthashDatasetDir
   157  	}
   158  	if dec.EthashDatasetsInMem != nil {
   159  		c.EthashDatasetsInMem = *dec.EthashDatasetsInMem
   160  	}
   161  	if dec.EthashDatasetsOnDisk != nil {
   162  		c.EthashDatasetsOnDisk = *dec.EthashDatasetsOnDisk
   163  	}
   164  	if dec.TxPool != nil {
   165  		c.TxPool = *dec.TxPool
   166  	}
   167  	if dec.GPO != nil {
   168  		c.GPO = *dec.GPO
   169  	}
   170  	if dec.EnablePreimageRecording != nil {
   171  		c.EnablePreimageRecording = *dec.EnablePreimageRecording
   172  	}
   173  	if dec.Istanbul != nil {
   174  		c.Istanbul = *dec.Istanbul
   175  	}
   176  	if dec.DocRoot != nil {
   177  		c.DocRoot = *dec.DocRoot
   178  	}
   179  	if dec.PowFake != nil {
   180  		c.PowFake = *dec.PowFake
   181  	}
   182  	if dec.PowTest != nil {
   183  		c.PowTest = *dec.PowTest
   184  	}
   185  	if dec.PowShared != nil {
   186  		c.PowShared = *dec.PowShared
   187  	}
   188  	return nil
   189  }