gen_config.go 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  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. SkipBcVersionCheck bool `toml:"-"`
  24. DatabaseHandles int `toml:"-"`
  25. DatabaseCache int
  26. TrieCache int
  27. TrieTimeout time.Duration
  28. Etherbase common.Address `toml:",omitempty"`
  29. MinerNotify []string `toml:",omitempty"`
  30. MinerExtraData hexutil.Bytes `toml:",omitempty"`
  31. MinerGasPrice *big.Int
  32. MinerRecommit time.Duration
  33. MinerNoverify bool
  34. Ethash ethash.Config
  35. TxPool core.TxPoolConfig
  36. GPO gasprice.Config
  37. EnablePreimageRecording bool
  38. DocRoot string `toml:"-"`
  39. }
  40. var enc Config
  41. enc.Genesis = c.Genesis
  42. enc.NetworkId = c.NetworkId
  43. enc.SyncMode = c.SyncMode
  44. enc.NoPruning = c.NoPruning
  45. enc.LightServ = c.LightServ
  46. enc.LightPeers = c.LightPeers
  47. enc.SkipBcVersionCheck = c.SkipBcVersionCheck
  48. enc.DatabaseHandles = c.DatabaseHandles
  49. enc.DatabaseCache = c.DatabaseCache
  50. enc.TrieCache = c.TrieCache
  51. enc.TrieTimeout = c.TrieTimeout
  52. enc.Etherbase = c.Etherbase
  53. enc.MinerNotify = c.MinerNotify
  54. enc.MinerExtraData = c.MinerExtraData
  55. enc.MinerGasPrice = c.MinerGasPrice
  56. enc.MinerRecommit = c.MinerRecommit
  57. enc.MinerNoverify = c.MinerNoverify
  58. enc.Ethash = c.Ethash
  59. enc.TxPool = c.TxPool
  60. enc.GPO = c.GPO
  61. enc.EnablePreimageRecording = c.EnablePreimageRecording
  62. enc.DocRoot = c.DocRoot
  63. return &enc, nil
  64. }
  65. // UnmarshalTOML unmarshals from TOML.
  66. func (c *Config) UnmarshalTOML(unmarshal func(interface{}) error) error {
  67. type Config struct {
  68. Genesis *core.Genesis `toml:",omitempty"`
  69. NetworkId *uint64
  70. SyncMode *downloader.SyncMode
  71. NoPruning *bool
  72. LightServ *int `toml:",omitempty"`
  73. LightPeers *int `toml:",omitempty"`
  74. SkipBcVersionCheck *bool `toml:"-"`
  75. DatabaseHandles *int `toml:"-"`
  76. DatabaseCache *int
  77. TrieCache *int
  78. TrieTimeout *time.Duration
  79. Etherbase *common.Address `toml:",omitempty"`
  80. MinerNotify []string `toml:",omitempty"`
  81. MinerExtraData *hexutil.Bytes `toml:",omitempty"`
  82. MinerGasPrice *big.Int
  83. MinerRecommit *time.Duration
  84. MinerNoverify *bool
  85. Ethash *ethash.Config
  86. TxPool *core.TxPoolConfig
  87. GPO *gasprice.Config
  88. EnablePreimageRecording *bool
  89. DocRoot *string `toml:"-"`
  90. }
  91. var dec Config
  92. if err := unmarshal(&dec); err != nil {
  93. return err
  94. }
  95. if dec.Genesis != nil {
  96. c.Genesis = dec.Genesis
  97. }
  98. if dec.NetworkId != nil {
  99. c.NetworkId = *dec.NetworkId
  100. }
  101. if dec.SyncMode != nil {
  102. c.SyncMode = *dec.SyncMode
  103. }
  104. if dec.NoPruning != nil {
  105. c.NoPruning = *dec.NoPruning
  106. }
  107. if dec.LightServ != nil {
  108. c.LightServ = *dec.LightServ
  109. }
  110. if dec.LightPeers != nil {
  111. c.LightPeers = *dec.LightPeers
  112. }
  113. if dec.SkipBcVersionCheck != nil {
  114. c.SkipBcVersionCheck = *dec.SkipBcVersionCheck
  115. }
  116. if dec.DatabaseHandles != nil {
  117. c.DatabaseHandles = *dec.DatabaseHandles
  118. }
  119. if dec.DatabaseCache != nil {
  120. c.DatabaseCache = *dec.DatabaseCache
  121. }
  122. if dec.TrieCache != nil {
  123. c.TrieCache = *dec.TrieCache
  124. }
  125. if dec.TrieTimeout != nil {
  126. c.TrieTimeout = *dec.TrieTimeout
  127. }
  128. if dec.Etherbase != nil {
  129. c.Etherbase = *dec.Etherbase
  130. }
  131. if dec.MinerNotify != nil {
  132. c.MinerNotify = dec.MinerNotify
  133. }
  134. if dec.MinerExtraData != nil {
  135. c.MinerExtraData = *dec.MinerExtraData
  136. }
  137. if dec.MinerGasPrice != nil {
  138. c.MinerGasPrice = dec.MinerGasPrice
  139. }
  140. if dec.MinerRecommit != nil {
  141. c.MinerRecommit = *dec.MinerRecommit
  142. }
  143. if dec.MinerNoverify != nil {
  144. c.MinerNoverify = *dec.MinerNoverify
  145. }
  146. if dec.Ethash != nil {
  147. c.Ethash = *dec.Ethash
  148. }
  149. if dec.TxPool != nil {
  150. c.TxPool = *dec.TxPool
  151. }
  152. if dec.GPO != nil {
  153. c.GPO = *dec.GPO
  154. }
  155. if dec.EnablePreimageRecording != nil {
  156. c.EnablePreimageRecording = *dec.EnablePreimageRecording
  157. }
  158. if dec.DocRoot != nil {
  159. c.DocRoot = *dec.DocRoot
  160. }
  161. return nil
  162. }