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