github.com/snowblossomcoin/go-ethereum@v1.9.25/eth/gen_config.go (about)

     1  // Code generated by github.com/fjl/gencodec. DO NOT EDIT.
     2  
     3  package eth
     4  
     5  import (
     6  	"time"
     7  
     8  	"github.com/ethereum/go-ethereum/common"
     9  	"github.com/ethereum/go-ethereum/consensus/ethash"
    10  	"github.com/ethereum/go-ethereum/core"
    11  	"github.com/ethereum/go-ethereum/eth/downloader"
    12  	"github.com/ethereum/go-ethereum/eth/gasprice"
    13  	"github.com/ethereum/go-ethereum/miner"
    14  	"github.com/ethereum/go-ethereum/params"
    15  )
    16  
    17  // MarshalTOML marshals as TOML.
    18  func (c Config) MarshalTOML() (interface{}, error) {
    19  	type Config struct {
    20  		Genesis                 *core.Genesis `toml:",omitempty"`
    21  		NetworkId               uint64
    22  		SyncMode                downloader.SyncMode
    23  		DiscoveryURLs           []string
    24  		NoPruning               bool
    25  		NoPrefetch              bool
    26  		TxLookupLimit           uint64                 `toml:",omitempty"`
    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  		LightNoPrune            bool                   `toml:",omitempty"`
    33  		UltraLightServers       []string               `toml:",omitempty"`
    34  		UltraLightFraction      int                    `toml:",omitempty"`
    35  		UltraLightOnlyAnnounce  bool                   `toml:",omitempty"`
    36  		SkipBcVersionCheck      bool                   `toml:"-"`
    37  		DatabaseHandles         int                    `toml:"-"`
    38  		DatabaseCache           int
    39  		DatabaseFreezer         string
    40  		TrieCleanCache          int
    41  		TrieCleanCacheJournal   string        `toml:",omitempty"`
    42  		TrieCleanCacheRejournal time.Duration `toml:",omitempty"`
    43  		TrieDirtyCache          int
    44  		TrieTimeout             time.Duration
    45  		SnapshotCache           int
    46  		Miner                   miner.Config
    47  		Ethash                  ethash.Config
    48  		TxPool                  core.TxPoolConfig
    49  		GPO                     gasprice.Config
    50  		EnablePreimageRecording bool
    51  		DocRoot                 string `toml:"-"`
    52  		EWASMInterpreter        string
    53  		EVMInterpreter          string
    54  		RPCGasCap               uint64                         `toml:",omitempty"`
    55  		RPCTxFeeCap             float64                        `toml:",omitempty"`
    56  		Checkpoint              *params.TrustedCheckpoint      `toml:",omitempty"`
    57  		CheckpointOracle        *params.CheckpointOracleConfig `toml:",omitempty"`
    58  	}
    59  	var enc Config
    60  	enc.Genesis = c.Genesis
    61  	enc.NetworkId = c.NetworkId
    62  	enc.SyncMode = c.SyncMode
    63  	enc.DiscoveryURLs = c.DiscoveryURLs
    64  	enc.NoPruning = c.NoPruning
    65  	enc.NoPrefetch = c.NoPrefetch
    66  	enc.TxLookupLimit = c.TxLookupLimit
    67  	enc.Whitelist = c.Whitelist
    68  	enc.LightServ = c.LightServ
    69  	enc.LightIngress = c.LightIngress
    70  	enc.LightEgress = c.LightEgress
    71  	enc.LightPeers = c.LightPeers
    72  	enc.LightNoPrune = c.LightNoPrune
    73  	enc.UltraLightServers = c.UltraLightServers
    74  	enc.UltraLightFraction = c.UltraLightFraction
    75  	enc.UltraLightOnlyAnnounce = c.UltraLightOnlyAnnounce
    76  	enc.SkipBcVersionCheck = c.SkipBcVersionCheck
    77  	enc.DatabaseHandles = c.DatabaseHandles
    78  	enc.DatabaseCache = c.DatabaseCache
    79  	enc.DatabaseFreezer = c.DatabaseFreezer
    80  	enc.TrieCleanCache = c.TrieCleanCache
    81  	enc.TrieCleanCacheJournal = c.TrieCleanCacheJournal
    82  	enc.TrieCleanCacheRejournal = c.TrieCleanCacheRejournal
    83  	enc.TrieDirtyCache = c.TrieDirtyCache
    84  	enc.TrieTimeout = c.TrieTimeout
    85  	enc.SnapshotCache = c.SnapshotCache
    86  	enc.Miner = c.Miner
    87  	enc.Ethash = c.Ethash
    88  	enc.TxPool = c.TxPool
    89  	enc.GPO = c.GPO
    90  	enc.EnablePreimageRecording = c.EnablePreimageRecording
    91  	enc.DocRoot = c.DocRoot
    92  	enc.EWASMInterpreter = c.EWASMInterpreter
    93  	enc.EVMInterpreter = c.EVMInterpreter
    94  	enc.RPCGasCap = c.RPCGasCap
    95  	enc.RPCTxFeeCap = c.RPCTxFeeCap
    96  	enc.Checkpoint = c.Checkpoint
    97  	enc.CheckpointOracle = c.CheckpointOracle
    98  	return &enc, nil
    99  }
   100  
   101  // UnmarshalTOML unmarshals from TOML.
   102  func (c *Config) UnmarshalTOML(unmarshal func(interface{}) error) error {
   103  	type Config struct {
   104  		Genesis                 *core.Genesis `toml:",omitempty"`
   105  		NetworkId               *uint64
   106  		SyncMode                *downloader.SyncMode
   107  		DiscoveryURLs           []string
   108  		NoPruning               *bool
   109  		NoPrefetch              *bool
   110  		TxLookupLimit           *uint64                `toml:",omitempty"`
   111  		Whitelist               map[uint64]common.Hash `toml:"-"`
   112  		LightServ               *int                   `toml:",omitempty"`
   113  		LightIngress            *int                   `toml:",omitempty"`
   114  		LightEgress             *int                   `toml:",omitempty"`
   115  		LightPeers              *int                   `toml:",omitempty"`
   116  		LightNoPrune            *bool                  `toml:",omitempty"`
   117  		UltraLightServers       []string               `toml:",omitempty"`
   118  		UltraLightFraction      *int                   `toml:",omitempty"`
   119  		UltraLightOnlyAnnounce  *bool                  `toml:",omitempty"`
   120  		SkipBcVersionCheck      *bool                  `toml:"-"`
   121  		DatabaseHandles         *int                   `toml:"-"`
   122  		DatabaseCache           *int
   123  		DatabaseFreezer         *string
   124  		TrieCleanCache          *int
   125  		TrieCleanCacheJournal   *string        `toml:",omitempty"`
   126  		TrieCleanCacheRejournal *time.Duration `toml:",omitempty"`
   127  		TrieDirtyCache          *int
   128  		TrieTimeout             *time.Duration
   129  		SnapshotCache           *int
   130  		Miner                   *miner.Config
   131  		Ethash                  *ethash.Config
   132  		TxPool                  *core.TxPoolConfig
   133  		GPO                     *gasprice.Config
   134  		EnablePreimageRecording *bool
   135  		DocRoot                 *string `toml:"-"`
   136  		EWASMInterpreter        *string
   137  		EVMInterpreter          *string
   138  		RPCGasCap               *uint64                        `toml:",omitempty"`
   139  		RPCTxFeeCap             *float64                       `toml:",omitempty"`
   140  		Checkpoint              *params.TrustedCheckpoint      `toml:",omitempty"`
   141  		CheckpointOracle        *params.CheckpointOracleConfig `toml:",omitempty"`
   142  	}
   143  	var dec Config
   144  	if err := unmarshal(&dec); err != nil {
   145  		return err
   146  	}
   147  	if dec.Genesis != nil {
   148  		c.Genesis = dec.Genesis
   149  	}
   150  	if dec.NetworkId != nil {
   151  		c.NetworkId = *dec.NetworkId
   152  	}
   153  	if dec.SyncMode != nil {
   154  		c.SyncMode = *dec.SyncMode
   155  	}
   156  	if dec.DiscoveryURLs != nil {
   157  		c.DiscoveryURLs = dec.DiscoveryURLs
   158  	}
   159  	if dec.NoPruning != nil {
   160  		c.NoPruning = *dec.NoPruning
   161  	}
   162  	if dec.NoPrefetch != nil {
   163  		c.NoPrefetch = *dec.NoPrefetch
   164  	}
   165  	if dec.TxLookupLimit != nil {
   166  		c.TxLookupLimit = *dec.TxLookupLimit
   167  	}
   168  	if dec.Whitelist != nil {
   169  		c.Whitelist = dec.Whitelist
   170  	}
   171  	if dec.LightServ != nil {
   172  		c.LightServ = *dec.LightServ
   173  	}
   174  	if dec.LightIngress != nil {
   175  		c.LightIngress = *dec.LightIngress
   176  	}
   177  	if dec.LightEgress != nil {
   178  		c.LightEgress = *dec.LightEgress
   179  	}
   180  	if dec.LightPeers != nil {
   181  		c.LightPeers = *dec.LightPeers
   182  	}
   183  	if dec.LightNoPrune != nil {
   184  		c.LightNoPrune = *dec.LightNoPrune
   185  	}
   186  	if dec.UltraLightServers != nil {
   187  		c.UltraLightServers = dec.UltraLightServers
   188  	}
   189  	if dec.UltraLightFraction != nil {
   190  		c.UltraLightFraction = *dec.UltraLightFraction
   191  	}
   192  	if dec.UltraLightOnlyAnnounce != nil {
   193  		c.UltraLightOnlyAnnounce = *dec.UltraLightOnlyAnnounce
   194  	}
   195  	if dec.SkipBcVersionCheck != nil {
   196  		c.SkipBcVersionCheck = *dec.SkipBcVersionCheck
   197  	}
   198  	if dec.DatabaseHandles != nil {
   199  		c.DatabaseHandles = *dec.DatabaseHandles
   200  	}
   201  	if dec.DatabaseCache != nil {
   202  		c.DatabaseCache = *dec.DatabaseCache
   203  	}
   204  	if dec.DatabaseFreezer != nil {
   205  		c.DatabaseFreezer = *dec.DatabaseFreezer
   206  	}
   207  	if dec.TrieCleanCache != nil {
   208  		c.TrieCleanCache = *dec.TrieCleanCache
   209  	}
   210  	if dec.TrieCleanCacheJournal != nil {
   211  		c.TrieCleanCacheJournal = *dec.TrieCleanCacheJournal
   212  	}
   213  	if dec.TrieCleanCacheRejournal != nil {
   214  		c.TrieCleanCacheRejournal = *dec.TrieCleanCacheRejournal
   215  	}
   216  	if dec.TrieDirtyCache != nil {
   217  		c.TrieDirtyCache = *dec.TrieDirtyCache
   218  	}
   219  	if dec.TrieTimeout != nil {
   220  		c.TrieTimeout = *dec.TrieTimeout
   221  	}
   222  	if dec.SnapshotCache != nil {
   223  		c.SnapshotCache = *dec.SnapshotCache
   224  	}
   225  	if dec.Miner != nil {
   226  		c.Miner = *dec.Miner
   227  	}
   228  	if dec.Ethash != nil {
   229  		c.Ethash = *dec.Ethash
   230  	}
   231  	if dec.TxPool != nil {
   232  		c.TxPool = *dec.TxPool
   233  	}
   234  	if dec.GPO != nil {
   235  		c.GPO = *dec.GPO
   236  	}
   237  	if dec.EnablePreimageRecording != nil {
   238  		c.EnablePreimageRecording = *dec.EnablePreimageRecording
   239  	}
   240  	if dec.DocRoot != nil {
   241  		c.DocRoot = *dec.DocRoot
   242  	}
   243  	if dec.EWASMInterpreter != nil {
   244  		c.EWASMInterpreter = *dec.EWASMInterpreter
   245  	}
   246  	if dec.EVMInterpreter != nil {
   247  		c.EVMInterpreter = *dec.EVMInterpreter
   248  	}
   249  	if dec.RPCGasCap != nil {
   250  		c.RPCGasCap = *dec.RPCGasCap
   251  	}
   252  	if dec.RPCTxFeeCap != nil {
   253  		c.RPCTxFeeCap = *dec.RPCTxFeeCap
   254  	}
   255  	if dec.Checkpoint != nil {
   256  		c.Checkpoint = dec.Checkpoint
   257  	}
   258  	if dec.CheckpointOracle != nil {
   259  		c.CheckpointOracle = dec.CheckpointOracle
   260  	}
   261  	return nil
   262  }