gen_config.go 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. // Code generated by github.com/fjl/gencodec. DO NOT EDIT.
  2. package eth
  3. import (
  4. "math/big"
  5. "github.com/ethereum/go-ethereum/common"
  6. "github.com/ethereum/go-ethereum/common/hexutil"
  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. )
  12. var _ = (*configMarshaling)(nil)
  13. func (c Config) MarshalTOML() (interface{}, error) {
  14. type Config struct {
  15. Genesis *core.Genesis `toml:",omitempty"`
  16. NetworkId uint64
  17. SyncMode downloader.SyncMode
  18. LightServ int `toml:",omitempty"`
  19. LightPeers int `toml:",omitempty"`
  20. SkipBcVersionCheck bool `toml:"-"`
  21. DatabaseHandles int `toml:"-"`
  22. DatabaseCache int
  23. Etherbase common.Address `toml:",omitempty"`
  24. MinerThreads int `toml:",omitempty"`
  25. ExtraData hexutil.Bytes `toml:",omitempty"`
  26. GasPrice *big.Int
  27. Ethash ethash.Config
  28. TxPool core.TxPoolConfig
  29. GPO gasprice.Config
  30. EnablePreimageRecording bool
  31. DocRoot string `toml:"-"`
  32. }
  33. var enc Config
  34. enc.Genesis = c.Genesis
  35. enc.NetworkId = c.NetworkId
  36. enc.SyncMode = c.SyncMode
  37. enc.LightServ = c.LightServ
  38. enc.LightPeers = c.LightPeers
  39. enc.SkipBcVersionCheck = c.SkipBcVersionCheck
  40. enc.DatabaseHandles = c.DatabaseHandles
  41. enc.DatabaseCache = c.DatabaseCache
  42. enc.Etherbase = c.Etherbase
  43. enc.MinerThreads = c.MinerThreads
  44. enc.ExtraData = c.ExtraData
  45. enc.GasPrice = c.GasPrice
  46. enc.Ethash = c.Ethash
  47. enc.TxPool = c.TxPool
  48. enc.GPO = c.GPO
  49. enc.EnablePreimageRecording = c.EnablePreimageRecording
  50. enc.DocRoot = c.DocRoot
  51. return &enc, nil
  52. }
  53. func (c *Config) UnmarshalTOML(unmarshal func(interface{}) error) error {
  54. type Config struct {
  55. Genesis *core.Genesis `toml:",omitempty"`
  56. NetworkId *uint64
  57. SyncMode *downloader.SyncMode
  58. LightServ *int `toml:",omitempty"`
  59. LightPeers *int `toml:",omitempty"`
  60. SkipBcVersionCheck *bool `toml:"-"`
  61. DatabaseHandles *int `toml:"-"`
  62. DatabaseCache *int
  63. Etherbase *common.Address `toml:",omitempty"`
  64. MinerThreads *int `toml:",omitempty"`
  65. ExtraData *hexutil.Bytes `toml:",omitempty"`
  66. GasPrice *big.Int
  67. Ethash *ethash.Config
  68. TxPool *core.TxPoolConfig
  69. GPO *gasprice.Config
  70. EnablePreimageRecording *bool
  71. DocRoot *string `toml:"-"`
  72. }
  73. var dec Config
  74. if err := unmarshal(&dec); err != nil {
  75. return err
  76. }
  77. if dec.Genesis != nil {
  78. c.Genesis = dec.Genesis
  79. }
  80. if dec.NetworkId != nil {
  81. c.NetworkId = *dec.NetworkId
  82. }
  83. if dec.SyncMode != nil {
  84. c.SyncMode = *dec.SyncMode
  85. }
  86. if dec.LightServ != nil {
  87. c.LightServ = *dec.LightServ
  88. }
  89. if dec.LightPeers != nil {
  90. c.LightPeers = *dec.LightPeers
  91. }
  92. if dec.SkipBcVersionCheck != nil {
  93. c.SkipBcVersionCheck = *dec.SkipBcVersionCheck
  94. }
  95. if dec.DatabaseHandles != nil {
  96. c.DatabaseHandles = *dec.DatabaseHandles
  97. }
  98. if dec.DatabaseCache != nil {
  99. c.DatabaseCache = *dec.DatabaseCache
  100. }
  101. if dec.Etherbase != nil {
  102. c.Etherbase = *dec.Etherbase
  103. }
  104. if dec.MinerThreads != nil {
  105. c.MinerThreads = *dec.MinerThreads
  106. }
  107. if dec.ExtraData != nil {
  108. c.ExtraData = *dec.ExtraData
  109. }
  110. if dec.GasPrice != nil {
  111. c.GasPrice = dec.GasPrice
  112. }
  113. if dec.Ethash != nil {
  114. c.Ethash = *dec.Ethash
  115. }
  116. if dec.TxPool != nil {
  117. c.TxPool = *dec.TxPool
  118. }
  119. if dec.GPO != nil {
  120. c.GPO = *dec.GPO
  121. }
  122. if dec.EnablePreimageRecording != nil {
  123. c.EnablePreimageRecording = *dec.EnablePreimageRecording
  124. }
  125. if dec.DocRoot != nil {
  126. c.DocRoot = *dec.DocRoot
  127. }
  128. return nil
  129. }