github.1485827954.workers.dev/ethereum/go-ethereum@v1.14.3/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/ethereum/go-ethereum/common"
     9  	"github.com/ethereum/go-ethereum/core"
    10  	"github.com/ethereum/go-ethereum/core/txpool/blobpool"
    11  	"github.com/ethereum/go-ethereum/core/txpool/legacypool"
    12  	"github.com/ethereum/go-ethereum/eth/downloader"
    13  	"github.com/ethereum/go-ethereum/eth/gasprice"
    14  	"github.com/ethereum/go-ethereum/miner"
    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  		EthDiscoveryURLs        []string
    24  		SnapDiscoveryURLs       []string
    25  		NoPruning               bool
    26  		NoPrefetch              bool
    27  		TxLookupLimit           uint64                 `toml:",omitempty"`
    28  		TransactionHistory      uint64                 `toml:",omitempty"`
    29  		StateHistory            uint64                 `toml:",omitempty"`
    30  		StateScheme             string                 `toml:",omitempty"`
    31  		RequiredBlocks          map[uint64]common.Hash `toml:"-"`
    32  		LightServ               int                    `toml:",omitempty"`
    33  		LightIngress            int                    `toml:",omitempty"`
    34  		LightEgress             int                    `toml:",omitempty"`
    35  		LightPeers              int                    `toml:",omitempty"`
    36  		LightNoPrune            bool                   `toml:",omitempty"`
    37  		LightNoSyncServe        bool                   `toml:",omitempty"`
    38  		SkipBcVersionCheck      bool                   `toml:"-"`
    39  		DatabaseHandles         int                    `toml:"-"`
    40  		DatabaseCache           int
    41  		DatabaseFreezer         string
    42  		TrieCleanCache          int
    43  		TrieDirtyCache          int
    44  		TrieTimeout             time.Duration
    45  		SnapshotCache           int
    46  		Preimages               bool
    47  		FilterLogCacheSize      int
    48  		Miner                   miner.Config
    49  		TxPool                  legacypool.Config
    50  		BlobPool                blobpool.Config
    51  		GPO                     gasprice.Config
    52  		EnablePreimageRecording bool
    53  		VMTrace                 string
    54  		VMTraceJsonConfig       string
    55  		DocRoot                 string `toml:"-"`
    56  		RPCGasCap               uint64
    57  		RPCEVMTimeout           time.Duration
    58  		RPCTxFeeCap             float64
    59  		OverrideCancun          *uint64 `toml:",omitempty"`
    60  		OverrideVerkle          *uint64 `toml:",omitempty"`
    61  	}
    62  	var enc Config
    63  	enc.Genesis = c.Genesis
    64  	enc.NetworkId = c.NetworkId
    65  	enc.SyncMode = c.SyncMode
    66  	enc.EthDiscoveryURLs = c.EthDiscoveryURLs
    67  	enc.SnapDiscoveryURLs = c.SnapDiscoveryURLs
    68  	enc.NoPruning = c.NoPruning
    69  	enc.NoPrefetch = c.NoPrefetch
    70  	enc.TxLookupLimit = c.TxLookupLimit
    71  	enc.TransactionHistory = c.TransactionHistory
    72  	enc.StateHistory = c.StateHistory
    73  	enc.StateScheme = c.StateScheme
    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.SkipBcVersionCheck = c.SkipBcVersionCheck
    82  	enc.DatabaseHandles = c.DatabaseHandles
    83  	enc.DatabaseCache = c.DatabaseCache
    84  	enc.DatabaseFreezer = c.DatabaseFreezer
    85  	enc.TrieCleanCache = c.TrieCleanCache
    86  	enc.TrieDirtyCache = c.TrieDirtyCache
    87  	enc.TrieTimeout = c.TrieTimeout
    88  	enc.SnapshotCache = c.SnapshotCache
    89  	enc.Preimages = c.Preimages
    90  	enc.FilterLogCacheSize = c.FilterLogCacheSize
    91  	enc.Miner = c.Miner
    92  	enc.TxPool = c.TxPool
    93  	enc.BlobPool = c.BlobPool
    94  	enc.GPO = c.GPO
    95  	enc.EnablePreimageRecording = c.EnablePreimageRecording
    96  	enc.VMTrace = c.VMTrace
    97  	enc.VMTraceJsonConfig = c.VMTraceJsonConfig
    98  	enc.DocRoot = c.DocRoot
    99  	enc.RPCGasCap = c.RPCGasCap
   100  	enc.RPCEVMTimeout = c.RPCEVMTimeout
   101  	enc.RPCTxFeeCap = c.RPCTxFeeCap
   102  	enc.OverrideCancun = c.OverrideCancun
   103  	enc.OverrideVerkle = c.OverrideVerkle
   104  	return &enc, nil
   105  }
   106  
   107  // UnmarshalTOML unmarshals from TOML.
   108  func (c *Config) UnmarshalTOML(unmarshal func(interface{}) error) error {
   109  	type Config struct {
   110  		Genesis                 *core.Genesis `toml:",omitempty"`
   111  		NetworkId               *uint64
   112  		SyncMode                *downloader.SyncMode
   113  		EthDiscoveryURLs        []string
   114  		SnapDiscoveryURLs       []string
   115  		NoPruning               *bool
   116  		NoPrefetch              *bool
   117  		TxLookupLimit           *uint64                `toml:",omitempty"`
   118  		TransactionHistory      *uint64                `toml:",omitempty"`
   119  		StateHistory            *uint64                `toml:",omitempty"`
   120  		StateScheme             *string                `toml:",omitempty"`
   121  		RequiredBlocks          map[uint64]common.Hash `toml:"-"`
   122  		LightServ               *int                   `toml:",omitempty"`
   123  		LightIngress            *int                   `toml:",omitempty"`
   124  		LightEgress             *int                   `toml:",omitempty"`
   125  		LightPeers              *int                   `toml:",omitempty"`
   126  		LightNoPrune            *bool                  `toml:",omitempty"`
   127  		LightNoSyncServe        *bool                  `toml:",omitempty"`
   128  		SkipBcVersionCheck      *bool                  `toml:"-"`
   129  		DatabaseHandles         *int                   `toml:"-"`
   130  		DatabaseCache           *int
   131  		DatabaseFreezer         *string
   132  		TrieCleanCache          *int
   133  		TrieDirtyCache          *int
   134  		TrieTimeout             *time.Duration
   135  		SnapshotCache           *int
   136  		Preimages               *bool
   137  		FilterLogCacheSize      *int
   138  		Miner                   *miner.Config
   139  		TxPool                  *legacypool.Config
   140  		BlobPool                *blobpool.Config
   141  		GPO                     *gasprice.Config
   142  		EnablePreimageRecording *bool
   143  		VMTrace                 *string
   144  		VMTraceJsonConfig       *string
   145  		DocRoot                 *string `toml:"-"`
   146  		RPCGasCap               *uint64
   147  		RPCEVMTimeout           *time.Duration
   148  		RPCTxFeeCap             *float64
   149  		OverrideCancun          *uint64 `toml:",omitempty"`
   150  		OverrideVerkle          *uint64 `toml:",omitempty"`
   151  	}
   152  	var dec Config
   153  	if err := unmarshal(&dec); err != nil {
   154  		return err
   155  	}
   156  	if dec.Genesis != nil {
   157  		c.Genesis = dec.Genesis
   158  	}
   159  	if dec.NetworkId != nil {
   160  		c.NetworkId = *dec.NetworkId
   161  	}
   162  	if dec.SyncMode != nil {
   163  		c.SyncMode = *dec.SyncMode
   164  	}
   165  	if dec.EthDiscoveryURLs != nil {
   166  		c.EthDiscoveryURLs = dec.EthDiscoveryURLs
   167  	}
   168  	if dec.SnapDiscoveryURLs != nil {
   169  		c.SnapDiscoveryURLs = dec.SnapDiscoveryURLs
   170  	}
   171  	if dec.NoPruning != nil {
   172  		c.NoPruning = *dec.NoPruning
   173  	}
   174  	if dec.NoPrefetch != nil {
   175  		c.NoPrefetch = *dec.NoPrefetch
   176  	}
   177  	if dec.TxLookupLimit != nil {
   178  		c.TxLookupLimit = *dec.TxLookupLimit
   179  	}
   180  	if dec.TransactionHistory != nil {
   181  		c.TransactionHistory = *dec.TransactionHistory
   182  	}
   183  	if dec.StateHistory != nil {
   184  		c.StateHistory = *dec.StateHistory
   185  	}
   186  	if dec.StateScheme != nil {
   187  		c.StateScheme = *dec.StateScheme
   188  	}
   189  	if dec.RequiredBlocks != nil {
   190  		c.RequiredBlocks = dec.RequiredBlocks
   191  	}
   192  	if dec.LightServ != nil {
   193  		c.LightServ = *dec.LightServ
   194  	}
   195  	if dec.LightIngress != nil {
   196  		c.LightIngress = *dec.LightIngress
   197  	}
   198  	if dec.LightEgress != nil {
   199  		c.LightEgress = *dec.LightEgress
   200  	}
   201  	if dec.LightPeers != nil {
   202  		c.LightPeers = *dec.LightPeers
   203  	}
   204  	if dec.LightNoPrune != nil {
   205  		c.LightNoPrune = *dec.LightNoPrune
   206  	}
   207  	if dec.LightNoSyncServe != nil {
   208  		c.LightNoSyncServe = *dec.LightNoSyncServe
   209  	}
   210  	if dec.SkipBcVersionCheck != nil {
   211  		c.SkipBcVersionCheck = *dec.SkipBcVersionCheck
   212  	}
   213  	if dec.DatabaseHandles != nil {
   214  		c.DatabaseHandles = *dec.DatabaseHandles
   215  	}
   216  	if dec.DatabaseCache != nil {
   217  		c.DatabaseCache = *dec.DatabaseCache
   218  	}
   219  	if dec.DatabaseFreezer != nil {
   220  		c.DatabaseFreezer = *dec.DatabaseFreezer
   221  	}
   222  	if dec.TrieCleanCache != nil {
   223  		c.TrieCleanCache = *dec.TrieCleanCache
   224  	}
   225  	if dec.TrieDirtyCache != nil {
   226  		c.TrieDirtyCache = *dec.TrieDirtyCache
   227  	}
   228  	if dec.TrieTimeout != nil {
   229  		c.TrieTimeout = *dec.TrieTimeout
   230  	}
   231  	if dec.SnapshotCache != nil {
   232  		c.SnapshotCache = *dec.SnapshotCache
   233  	}
   234  	if dec.Preimages != nil {
   235  		c.Preimages = *dec.Preimages
   236  	}
   237  	if dec.FilterLogCacheSize != nil {
   238  		c.FilterLogCacheSize = *dec.FilterLogCacheSize
   239  	}
   240  	if dec.Miner != nil {
   241  		c.Miner = *dec.Miner
   242  	}
   243  	if dec.TxPool != nil {
   244  		c.TxPool = *dec.TxPool
   245  	}
   246  	if dec.BlobPool != nil {
   247  		c.BlobPool = *dec.BlobPool
   248  	}
   249  	if dec.GPO != nil {
   250  		c.GPO = *dec.GPO
   251  	}
   252  	if dec.EnablePreimageRecording != nil {
   253  		c.EnablePreimageRecording = *dec.EnablePreimageRecording
   254  	}
   255  	if dec.VMTrace != nil {
   256  		c.VMTrace = *dec.VMTrace
   257  	}
   258  	if dec.VMTraceJsonConfig != nil {
   259  		c.VMTraceJsonConfig = *dec.VMTraceJsonConfig
   260  	}
   261  	if dec.DocRoot != nil {
   262  		c.DocRoot = *dec.DocRoot
   263  	}
   264  	if dec.RPCGasCap != nil {
   265  		c.RPCGasCap = *dec.RPCGasCap
   266  	}
   267  	if dec.RPCEVMTimeout != nil {
   268  		c.RPCEVMTimeout = *dec.RPCEVMTimeout
   269  	}
   270  	if dec.RPCTxFeeCap != nil {
   271  		c.RPCTxFeeCap = *dec.RPCTxFeeCap
   272  	}
   273  	if dec.OverrideCancun != nil {
   274  		c.OverrideCancun = dec.OverrideCancun
   275  	}
   276  	if dec.OverrideVerkle != nil {
   277  		c.OverrideVerkle = dec.OverrideVerkle
   278  	}
   279  	return nil
   280  }