github.com/tacshi/go-ethereum@v0.0.0-20230616113857-84a434e20921/eth/ethconfig/gen_config.go (about)

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