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