gen_config.go 6.0 KB

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