gen_config.go 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202
  1. // Code generated by github.com/fjl/gencodec. DO NOT EDIT.
  2. package eth
  3. import (
  4. "math/big"
  5. "time"
  6. "github.com/ethereum/go-ethereum/common"
  7. "github.com/ethereum/go-ethereum/consensus/ethash"
  8. "github.com/ethereum/go-ethereum/core"
  9. "github.com/ethereum/go-ethereum/eth/downloader"
  10. "github.com/ethereum/go-ethereum/eth/gasprice"
  11. "github.com/ethereum/go-ethereum/miner"
  12. )
  13. // MarshalTOML marshals as TOML.
  14. func (c Config) MarshalTOML() (interface{}, error) {
  15. type Config struct {
  16. Genesis *core.Genesis `toml:",omitempty"`
  17. NetworkId uint64
  18. SyncMode downloader.SyncMode
  19. NoPruning bool
  20. NoPrefetch bool
  21. Whitelist map[uint64]common.Hash `toml:"-"`
  22. LightServ int `toml:",omitempty"`
  23. LightBandwidthIn int `toml:",omitempty"`
  24. LightBandwidthOut int `toml:",omitempty"`
  25. LightPeers int `toml:",omitempty"`
  26. OnlyAnnounce bool
  27. ULC *ULCConfig `toml:",omitempty"`
  28. SkipBcVersionCheck bool `toml:"-"`
  29. DatabaseHandles int `toml:"-"`
  30. DatabaseCache int
  31. TrieCleanCache int
  32. TrieDirtyCache int
  33. TrieTimeout time.Duration
  34. Miner miner.Config
  35. Ethash ethash.Config
  36. TxPool core.TxPoolConfig
  37. GPO gasprice.Config
  38. EnablePreimageRecording bool
  39. DocRoot string `toml:"-"`
  40. EWASMInterpreter string
  41. EVMInterpreter string
  42. ConstantinopleOverride *big.Int
  43. RPCGasCap *big.Int `toml:",omitempty"`
  44. }
  45. var enc Config
  46. enc.Genesis = c.Genesis
  47. enc.NetworkId = c.NetworkId
  48. enc.SyncMode = c.SyncMode
  49. enc.NoPruning = c.NoPruning
  50. enc.NoPrefetch = c.NoPrefetch
  51. enc.Whitelist = c.Whitelist
  52. enc.LightServ = c.LightServ
  53. enc.LightBandwidthIn = c.LightBandwidthIn
  54. enc.LightBandwidthOut = c.LightBandwidthOut
  55. enc.LightPeers = c.LightPeers
  56. enc.OnlyAnnounce = c.OnlyAnnounce
  57. enc.ULC = c.ULC
  58. enc.SkipBcVersionCheck = c.SkipBcVersionCheck
  59. enc.DatabaseHandles = c.DatabaseHandles
  60. enc.DatabaseCache = c.DatabaseCache
  61. enc.TrieCleanCache = c.TrieCleanCache
  62. enc.TrieDirtyCache = c.TrieDirtyCache
  63. enc.TrieTimeout = c.TrieTimeout
  64. enc.Miner = c.Miner
  65. enc.Ethash = c.Ethash
  66. enc.TxPool = c.TxPool
  67. enc.GPO = c.GPO
  68. enc.EnablePreimageRecording = c.EnablePreimageRecording
  69. enc.DocRoot = c.DocRoot
  70. enc.EWASMInterpreter = c.EWASMInterpreter
  71. enc.EVMInterpreter = c.EVMInterpreter
  72. enc.ConstantinopleOverride = c.ConstantinopleOverride
  73. enc.RPCGasCap = c.RPCGasCap
  74. return &enc, nil
  75. }
  76. // UnmarshalTOML unmarshals from TOML.
  77. func (c *Config) UnmarshalTOML(unmarshal func(interface{}) error) error {
  78. type Config struct {
  79. Genesis *core.Genesis `toml:",omitempty"`
  80. NetworkId *uint64
  81. SyncMode *downloader.SyncMode
  82. NoPruning *bool
  83. NoPrefetch *bool
  84. Whitelist map[uint64]common.Hash `toml:"-"`
  85. LightServ *int `toml:",omitempty"`
  86. LightBandwidthIn *int `toml:",omitempty"`
  87. LightBandwidthOut *int `toml:",omitempty"`
  88. LightPeers *int `toml:",omitempty"`
  89. OnlyAnnounce *bool
  90. ULC *ULCConfig `toml:",omitempty"`
  91. SkipBcVersionCheck *bool `toml:"-"`
  92. DatabaseHandles *int `toml:"-"`
  93. DatabaseCache *int
  94. TrieCleanCache *int
  95. TrieDirtyCache *int
  96. TrieTimeout *time.Duration
  97. Miner *miner.Config
  98. Ethash *ethash.Config
  99. TxPool *core.TxPoolConfig
  100. GPO *gasprice.Config
  101. EnablePreimageRecording *bool
  102. DocRoot *string `toml:"-"`
  103. EWASMInterpreter *string
  104. EVMInterpreter *string
  105. ConstantinopleOverride *big.Int
  106. RPCGasCap *big.Int `toml:",omitempty"`
  107. }
  108. var dec Config
  109. if err := unmarshal(&dec); err != nil {
  110. return err
  111. }
  112. if dec.Genesis != nil {
  113. c.Genesis = dec.Genesis
  114. }
  115. if dec.NetworkId != nil {
  116. c.NetworkId = *dec.NetworkId
  117. }
  118. if dec.SyncMode != nil {
  119. c.SyncMode = *dec.SyncMode
  120. }
  121. if dec.NoPruning != nil {
  122. c.NoPruning = *dec.NoPruning
  123. }
  124. if dec.NoPrefetch != nil {
  125. c.NoPrefetch = *dec.NoPrefetch
  126. }
  127. if dec.Whitelist != nil {
  128. c.Whitelist = dec.Whitelist
  129. }
  130. if dec.LightServ != nil {
  131. c.LightServ = *dec.LightServ
  132. }
  133. if dec.LightBandwidthIn != nil {
  134. c.LightBandwidthIn = *dec.LightBandwidthIn
  135. }
  136. if dec.LightBandwidthOut != nil {
  137. c.LightBandwidthOut = *dec.LightBandwidthOut
  138. }
  139. if dec.LightPeers != nil {
  140. c.LightPeers = *dec.LightPeers
  141. }
  142. if dec.OnlyAnnounce != nil {
  143. c.OnlyAnnounce = *dec.OnlyAnnounce
  144. }
  145. if dec.ULC != nil {
  146. c.ULC = dec.ULC
  147. }
  148. if dec.SkipBcVersionCheck != nil {
  149. c.SkipBcVersionCheck = *dec.SkipBcVersionCheck
  150. }
  151. if dec.DatabaseHandles != nil {
  152. c.DatabaseHandles = *dec.DatabaseHandles
  153. }
  154. if dec.DatabaseCache != nil {
  155. c.DatabaseCache = *dec.DatabaseCache
  156. }
  157. if dec.TrieCleanCache != nil {
  158. c.TrieCleanCache = *dec.TrieCleanCache
  159. }
  160. if dec.TrieDirtyCache != nil {
  161. c.TrieDirtyCache = *dec.TrieDirtyCache
  162. }
  163. if dec.TrieTimeout != nil {
  164. c.TrieTimeout = *dec.TrieTimeout
  165. }
  166. if dec.Miner != nil {
  167. c.Miner = *dec.Miner
  168. }
  169. if dec.Ethash != nil {
  170. c.Ethash = *dec.Ethash
  171. }
  172. if dec.TxPool != nil {
  173. c.TxPool = *dec.TxPool
  174. }
  175. if dec.GPO != nil {
  176. c.GPO = *dec.GPO
  177. }
  178. if dec.EnablePreimageRecording != nil {
  179. c.EnablePreimageRecording = *dec.EnablePreimageRecording
  180. }
  181. if dec.DocRoot != nil {
  182. c.DocRoot = *dec.DocRoot
  183. }
  184. if dec.EWASMInterpreter != nil {
  185. c.EWASMInterpreter = *dec.EWASMInterpreter
  186. }
  187. if dec.EVMInterpreter != nil {
  188. c.EVMInterpreter = *dec.EVMInterpreter
  189. }
  190. if dec.ConstantinopleOverride != nil {
  191. c.ConstantinopleOverride = dec.ConstantinopleOverride
  192. }
  193. if dec.RPCGasCap != nil {
  194. c.RPCGasCap = dec.RPCGasCap
  195. }
  196. return nil
  197. }