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