gitee.com/liu-zhao234568/cntest@v1.0.0/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 "math/big" 7 "time" 8 9 "gitee.com/liu-zhao234568/cntest/common" 10 "gitee.com/liu-zhao234568/cntest/consensus/ethash" 11 "gitee.com/liu-zhao234568/cntest/core" 12 "gitee.com/liu-zhao234568/cntest/eth/downloader" 13 "gitee.com/liu-zhao234568/cntest/eth/gasprice" 14 "gitee.com/liu-zhao234568/cntest/miner" 15 "gitee.com/liu-zhao234568/cntest/params" 16 ) 17 18 // MarshalTOML marshals as TOML. 19 func (c Config) MarshalTOML() (interface{}, error) { 20 type Config struct { 21 Genesis *core.Genesis `toml:",omitempty"` 22 NetworkId uint64 23 SyncMode downloader.SyncMode 24 EthDiscoveryURLs []string 25 SnapDiscoveryURLs []string 26 NoPruning bool 27 NoPrefetch bool 28 TxLookupLimit uint64 `toml:",omitempty"` 29 Whitelist map[uint64]common.Hash `toml:"-"` 30 LightServ int `toml:",omitempty"` 31 LightIngress int `toml:",omitempty"` 32 LightEgress int `toml:",omitempty"` 33 LightPeers int `toml:",omitempty"` 34 LightNoPrune bool `toml:",omitempty"` 35 LightNoSyncServe bool `toml:",omitempty"` 36 SyncFromCheckpoint bool `toml:",omitempty"` 37 UltraLightServers []string `toml:",omitempty"` 38 UltraLightFraction int `toml:",omitempty"` 39 UltraLightOnlyAnnounce bool `toml:",omitempty"` 40 SkipBcVersionCheck bool `toml:"-"` 41 DatabaseHandles int `toml:"-"` 42 DatabaseCache int 43 DatabaseFreezer string 44 TrieCleanCache int 45 TrieCleanCacheJournal string `toml:",omitempty"` 46 TrieCleanCacheRejournal time.Duration `toml:",omitempty"` 47 TrieDirtyCache int 48 TrieTimeout time.Duration 49 SnapshotCache int 50 Preimages bool 51 Miner miner.Config 52 Ethash ethash.Config 53 TxPool core.TxPoolConfig 54 GPO gasprice.Config 55 EnablePreimageRecording bool 56 DocRoot string `toml:"-"` 57 RPCGasCap uint64 58 RPCTxFeeCap float64 59 Checkpoint *params.TrustedCheckpoint `toml:",omitempty"` 60 CheckpointOracle *params.CheckpointOracleConfig `toml:",omitempty"` 61 OverrideLondon *big.Int `toml:",omitempty"` 62 } 63 var enc Config 64 enc.Genesis = c.Genesis 65 enc.NetworkId = c.NetworkId 66 enc.SyncMode = c.SyncMode 67 enc.EthDiscoveryURLs = c.EthDiscoveryURLs 68 enc.SnapDiscoveryURLs = c.SnapDiscoveryURLs 69 enc.NoPruning = c.NoPruning 70 enc.NoPrefetch = c.NoPrefetch 71 enc.TxLookupLimit = c.TxLookupLimit 72 enc.Whitelist = c.Whitelist 73 enc.LightServ = c.LightServ 74 enc.LightIngress = c.LightIngress 75 enc.LightEgress = c.LightEgress 76 enc.LightPeers = c.LightPeers 77 enc.LightNoPrune = c.LightNoPrune 78 enc.LightNoSyncServe = c.LightNoSyncServe 79 enc.SyncFromCheckpoint = c.SyncFromCheckpoint 80 enc.UltraLightServers = c.UltraLightServers 81 enc.UltraLightFraction = c.UltraLightFraction 82 enc.UltraLightOnlyAnnounce = c.UltraLightOnlyAnnounce 83 enc.SkipBcVersionCheck = c.SkipBcVersionCheck 84 enc.DatabaseHandles = c.DatabaseHandles 85 enc.DatabaseCache = c.DatabaseCache 86 enc.DatabaseFreezer = c.DatabaseFreezer 87 enc.TrieCleanCache = c.TrieCleanCache 88 enc.TrieCleanCacheJournal = c.TrieCleanCacheJournal 89 enc.TrieCleanCacheRejournal = c.TrieCleanCacheRejournal 90 enc.TrieDirtyCache = c.TrieDirtyCache 91 enc.TrieTimeout = c.TrieTimeout 92 enc.SnapshotCache = c.SnapshotCache 93 enc.Preimages = c.Preimages 94 enc.Miner = c.Miner 95 enc.Ethash = c.Ethash 96 enc.TxPool = c.TxPool 97 enc.GPO = c.GPO 98 enc.EnablePreimageRecording = c.EnablePreimageRecording 99 enc.DocRoot = c.DocRoot 100 enc.RPCGasCap = c.RPCGasCap 101 enc.RPCTxFeeCap = c.RPCTxFeeCap 102 enc.Checkpoint = c.Checkpoint 103 enc.CheckpointOracle = c.CheckpointOracle 104 enc.OverrideLondon = c.OverrideLondon 105 return &enc, nil 106 } 107 108 // UnmarshalTOML unmarshals from TOML. 109 func (c *Config) UnmarshalTOML(unmarshal func(interface{}) error) error { 110 type Config struct { 111 Genesis *core.Genesis `toml:",omitempty"` 112 NetworkId *uint64 113 SyncMode *downloader.SyncMode 114 EthDiscoveryURLs []string 115 SnapDiscoveryURLs []string 116 NoPruning *bool 117 NoPrefetch *bool 118 TxLookupLimit *uint64 `toml:",omitempty"` 119 Whitelist map[uint64]common.Hash `toml:"-"` 120 LightServ *int `toml:",omitempty"` 121 LightIngress *int `toml:",omitempty"` 122 LightEgress *int `toml:",omitempty"` 123 LightPeers *int `toml:",omitempty"` 124 LightNoPrune *bool `toml:",omitempty"` 125 LightNoSyncServe *bool `toml:",omitempty"` 126 SyncFromCheckpoint *bool `toml:",omitempty"` 127 UltraLightServers []string `toml:",omitempty"` 128 UltraLightFraction *int `toml:",omitempty"` 129 UltraLightOnlyAnnounce *bool `toml:",omitempty"` 130 SkipBcVersionCheck *bool `toml:"-"` 131 DatabaseHandles *int `toml:"-"` 132 DatabaseCache *int 133 DatabaseFreezer *string 134 TrieCleanCache *int 135 TrieCleanCacheJournal *string `toml:",omitempty"` 136 TrieCleanCacheRejournal *time.Duration `toml:",omitempty"` 137 TrieDirtyCache *int 138 TrieTimeout *time.Duration 139 SnapshotCache *int 140 Preimages *bool 141 Miner *miner.Config 142 Ethash *ethash.Config 143 TxPool *core.TxPoolConfig 144 GPO *gasprice.Config 145 EnablePreimageRecording *bool 146 DocRoot *string `toml:"-"` 147 RPCGasCap *uint64 148 RPCTxFeeCap *float64 149 Checkpoint *params.TrustedCheckpoint `toml:",omitempty"` 150 CheckpointOracle *params.CheckpointOracleConfig `toml:",omitempty"` 151 OverrideLondon *big.Int `toml:",omitempty"` 152 } 153 var dec Config 154 if err := unmarshal(&dec); err != nil { 155 return err 156 } 157 if dec.Genesis != nil { 158 c.Genesis = dec.Genesis 159 } 160 if dec.NetworkId != nil { 161 c.NetworkId = *dec.NetworkId 162 } 163 if dec.SyncMode != nil { 164 c.SyncMode = *dec.SyncMode 165 } 166 if dec.EthDiscoveryURLs != nil { 167 c.EthDiscoveryURLs = dec.EthDiscoveryURLs 168 } 169 if dec.SnapDiscoveryURLs != nil { 170 c.SnapDiscoveryURLs = dec.SnapDiscoveryURLs 171 } 172 if dec.NoPruning != nil { 173 c.NoPruning = *dec.NoPruning 174 } 175 if dec.NoPrefetch != nil { 176 c.NoPrefetch = *dec.NoPrefetch 177 } 178 if dec.TxLookupLimit != nil { 179 c.TxLookupLimit = *dec.TxLookupLimit 180 } 181 if dec.Whitelist != nil { 182 c.Whitelist = dec.Whitelist 183 } 184 if dec.LightServ != nil { 185 c.LightServ = *dec.LightServ 186 } 187 if dec.LightIngress != nil { 188 c.LightIngress = *dec.LightIngress 189 } 190 if dec.LightEgress != nil { 191 c.LightEgress = *dec.LightEgress 192 } 193 if dec.LightPeers != nil { 194 c.LightPeers = *dec.LightPeers 195 } 196 if dec.LightNoPrune != nil { 197 c.LightNoPrune = *dec.LightNoPrune 198 } 199 if dec.LightNoSyncServe != nil { 200 c.LightNoSyncServe = *dec.LightNoSyncServe 201 } 202 if dec.SyncFromCheckpoint != nil { 203 c.SyncFromCheckpoint = *dec.SyncFromCheckpoint 204 } 205 if dec.UltraLightServers != nil { 206 c.UltraLightServers = dec.UltraLightServers 207 } 208 if dec.UltraLightFraction != nil { 209 c.UltraLightFraction = *dec.UltraLightFraction 210 } 211 if dec.UltraLightOnlyAnnounce != nil { 212 c.UltraLightOnlyAnnounce = *dec.UltraLightOnlyAnnounce 213 } 214 if dec.SkipBcVersionCheck != nil { 215 c.SkipBcVersionCheck = *dec.SkipBcVersionCheck 216 } 217 if dec.DatabaseHandles != nil { 218 c.DatabaseHandles = *dec.DatabaseHandles 219 } 220 if dec.DatabaseCache != nil { 221 c.DatabaseCache = *dec.DatabaseCache 222 } 223 if dec.DatabaseFreezer != nil { 224 c.DatabaseFreezer = *dec.DatabaseFreezer 225 } 226 if dec.TrieCleanCache != nil { 227 c.TrieCleanCache = *dec.TrieCleanCache 228 } 229 if dec.TrieCleanCacheJournal != nil { 230 c.TrieCleanCacheJournal = *dec.TrieCleanCacheJournal 231 } 232 if dec.TrieCleanCacheRejournal != nil { 233 c.TrieCleanCacheRejournal = *dec.TrieCleanCacheRejournal 234 } 235 if dec.TrieDirtyCache != nil { 236 c.TrieDirtyCache = *dec.TrieDirtyCache 237 } 238 if dec.TrieTimeout != nil { 239 c.TrieTimeout = *dec.TrieTimeout 240 } 241 if dec.SnapshotCache != nil { 242 c.SnapshotCache = *dec.SnapshotCache 243 } 244 if dec.Preimages != nil { 245 c.Preimages = *dec.Preimages 246 } 247 if dec.Miner != nil { 248 c.Miner = *dec.Miner 249 } 250 if dec.Ethash != nil { 251 c.Ethash = *dec.Ethash 252 } 253 if dec.TxPool != nil { 254 c.TxPool = *dec.TxPool 255 } 256 if dec.GPO != nil { 257 c.GPO = *dec.GPO 258 } 259 if dec.EnablePreimageRecording != nil { 260 c.EnablePreimageRecording = *dec.EnablePreimageRecording 261 } 262 if dec.DocRoot != nil { 263 c.DocRoot = *dec.DocRoot 264 } 265 if dec.RPCGasCap != nil { 266 c.RPCGasCap = *dec.RPCGasCap 267 } 268 if dec.RPCTxFeeCap != nil { 269 c.RPCTxFeeCap = *dec.RPCTxFeeCap 270 } 271 if dec.Checkpoint != nil { 272 c.Checkpoint = dec.Checkpoint 273 } 274 if dec.CheckpointOracle != nil { 275 c.CheckpointOracle = dec.CheckpointOracle 276 } 277 if dec.OverrideLondon != nil { 278 c.OverrideLondon = dec.OverrideLondon 279 } 280 return nil 281 }