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