github.com/JFJun/bsc@v1.0.0/eth/gen_config.go (about) 1 // Code generated by github.com/fjl/gencodec. DO NOT EDIT. 2 3 package eth 4 5 import ( 6 "math/big" 7 "time" 8 9 "github.com/JFJun/bsc/common" 10 "github.com/JFJun/bsc/consensus/ethash" 11 "github.com/JFJun/bsc/core" 12 "github.com/JFJun/bsc/eth/downloader" 13 "github.com/JFJun/bsc/eth/gasprice" 14 "github.com/JFJun/bsc/miner" 15 "github.com/JFJun/bsc/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 DiscoveryURLs []string 25 NoPruning bool 26 NoPrefetch bool 27 Whitelist map[uint64]common.Hash `toml:"-"` 28 LightServ int `toml:",omitempty"` 29 LightIngress int `toml:",omitempty"` 30 LightEgress int `toml:",omitempty"` 31 LightPeers int `toml:",omitempty"` 32 UltraLightServers []string `toml:",omitempty"` 33 UltraLightFraction int `toml:",omitempty"` 34 UltraLightOnlyAnnounce bool `toml:",omitempty"` 35 SkipBcVersionCheck bool `toml:"-"` 36 DatabaseHandles int `toml:"-"` 37 DatabaseCache int 38 DatabaseFreezer string 39 TrieCleanCache int 40 TrieDirtyCache int 41 TrieTimeout time.Duration 42 Miner miner.Config 43 Ethash ethash.Config 44 TxPool core.TxPoolConfig 45 GPO gasprice.Config 46 EnablePreimageRecording bool 47 DocRoot string `toml:"-"` 48 EWASMInterpreter string 49 EVMInterpreter string 50 RPCGasCap *big.Int `toml:",omitempty"` 51 Checkpoint *params.TrustedCheckpoint `toml:",omitempty"` 52 CheckpointOracle *params.CheckpointOracleConfig `toml:",omitempty"` 53 OverrideIstanbul *big.Int `toml:",omitempty"` 54 OverrideMuirGlacier *big.Int `toml:",omitempty"` 55 } 56 var enc Config 57 enc.Genesis = c.Genesis 58 enc.NetworkId = c.NetworkId 59 enc.SyncMode = c.SyncMode 60 enc.DiscoveryURLs = c.DiscoveryURLs 61 enc.NoPruning = c.NoPruning 62 enc.NoPrefetch = c.NoPrefetch 63 enc.Whitelist = c.Whitelist 64 enc.LightServ = c.LightServ 65 enc.LightIngress = c.LightIngress 66 enc.LightEgress = c.LightEgress 67 enc.LightPeers = c.LightPeers 68 enc.UltraLightServers = c.UltraLightServers 69 enc.UltraLightFraction = c.UltraLightFraction 70 enc.UltraLightOnlyAnnounce = c.UltraLightOnlyAnnounce 71 enc.SkipBcVersionCheck = c.SkipBcVersionCheck 72 enc.DatabaseHandles = c.DatabaseHandles 73 enc.DatabaseCache = c.DatabaseCache 74 enc.DatabaseFreezer = c.DatabaseFreezer 75 enc.TrieCleanCache = c.TrieCleanCache 76 enc.TrieDirtyCache = c.TrieDirtyCache 77 enc.TrieTimeout = c.TrieTimeout 78 enc.Miner = c.Miner 79 enc.Ethash = c.Ethash 80 enc.TxPool = c.TxPool 81 enc.GPO = c.GPO 82 enc.EnablePreimageRecording = c.EnablePreimageRecording 83 enc.DocRoot = c.DocRoot 84 enc.EWASMInterpreter = c.EWASMInterpreter 85 enc.EVMInterpreter = c.EVMInterpreter 86 enc.RPCGasCap = c.RPCGasCap 87 enc.Checkpoint = c.Checkpoint 88 enc.CheckpointOracle = c.CheckpointOracle 89 enc.OverrideIstanbul = c.OverrideIstanbul 90 enc.OverrideMuirGlacier = c.OverrideMuirGlacier 91 return &enc, nil 92 } 93 94 // UnmarshalTOML unmarshals from TOML. 95 func (c *Config) UnmarshalTOML(unmarshal func(interface{}) error) error { 96 type Config struct { 97 Genesis *core.Genesis `toml:",omitempty"` 98 NetworkId *uint64 99 SyncMode *downloader.SyncMode 100 DiscoveryURLs []string 101 NoPruning *bool 102 NoPrefetch *bool 103 Whitelist map[uint64]common.Hash `toml:"-"` 104 LightServ *int `toml:",omitempty"` 105 LightIngress *int `toml:",omitempty"` 106 LightEgress *int `toml:",omitempty"` 107 LightPeers *int `toml:",omitempty"` 108 UltraLightServers []string `toml:",omitempty"` 109 UltraLightFraction *int `toml:",omitempty"` 110 UltraLightOnlyAnnounce *bool `toml:",omitempty"` 111 SkipBcVersionCheck *bool `toml:"-"` 112 DatabaseHandles *int `toml:"-"` 113 DatabaseCache *int 114 DatabaseFreezer *string 115 TrieCleanCache *int 116 TrieDirtyCache *int 117 TrieTimeout *time.Duration 118 Miner *miner.Config 119 Ethash *ethash.Config 120 TxPool *core.TxPoolConfig 121 GPO *gasprice.Config 122 EnablePreimageRecording *bool 123 DocRoot *string `toml:"-"` 124 EWASMInterpreter *string 125 EVMInterpreter *string 126 RPCGasCap *big.Int `toml:",omitempty"` 127 Checkpoint *params.TrustedCheckpoint `toml:",omitempty"` 128 CheckpointOracle *params.CheckpointOracleConfig `toml:",omitempty"` 129 OverrideIstanbul *big.Int `toml:",omitempty"` 130 OverrideMuirGlacier *big.Int `toml:",omitempty"` 131 } 132 var dec Config 133 if err := unmarshal(&dec); err != nil { 134 return err 135 } 136 if dec.Genesis != nil { 137 c.Genesis = dec.Genesis 138 } 139 if dec.NetworkId != nil { 140 c.NetworkId = *dec.NetworkId 141 } 142 if dec.SyncMode != nil { 143 c.SyncMode = *dec.SyncMode 144 } 145 if dec.DiscoveryURLs != nil { 146 c.DiscoveryURLs = dec.DiscoveryURLs 147 } 148 if dec.NoPruning != nil { 149 c.NoPruning = *dec.NoPruning 150 } 151 if dec.NoPrefetch != nil { 152 c.NoPrefetch = *dec.NoPrefetch 153 } 154 if dec.Whitelist != nil { 155 c.Whitelist = dec.Whitelist 156 } 157 if dec.LightServ != nil { 158 c.LightServ = *dec.LightServ 159 } 160 if dec.LightIngress != nil { 161 c.LightIngress = *dec.LightIngress 162 } 163 if dec.LightEgress != nil { 164 c.LightEgress = *dec.LightEgress 165 } 166 if dec.LightPeers != nil { 167 c.LightPeers = *dec.LightPeers 168 } 169 if dec.UltraLightServers != nil { 170 c.UltraLightServers = dec.UltraLightServers 171 } 172 if dec.UltraLightFraction != nil { 173 c.UltraLightFraction = *dec.UltraLightFraction 174 } 175 if dec.UltraLightOnlyAnnounce != nil { 176 c.UltraLightOnlyAnnounce = *dec.UltraLightOnlyAnnounce 177 } 178 if dec.SkipBcVersionCheck != nil { 179 c.SkipBcVersionCheck = *dec.SkipBcVersionCheck 180 } 181 if dec.DatabaseHandles != nil { 182 c.DatabaseHandles = *dec.DatabaseHandles 183 } 184 if dec.DatabaseCache != nil { 185 c.DatabaseCache = *dec.DatabaseCache 186 } 187 if dec.DatabaseFreezer != nil { 188 c.DatabaseFreezer = *dec.DatabaseFreezer 189 } 190 if dec.TrieCleanCache != nil { 191 c.TrieCleanCache = *dec.TrieCleanCache 192 } 193 if dec.TrieDirtyCache != nil { 194 c.TrieDirtyCache = *dec.TrieDirtyCache 195 } 196 if dec.TrieTimeout != nil { 197 c.TrieTimeout = *dec.TrieTimeout 198 } 199 if dec.Miner != nil { 200 c.Miner = *dec.Miner 201 } 202 if dec.Ethash != nil { 203 c.Ethash = *dec.Ethash 204 } 205 if dec.TxPool != nil { 206 c.TxPool = *dec.TxPool 207 } 208 if dec.GPO != nil { 209 c.GPO = *dec.GPO 210 } 211 if dec.EnablePreimageRecording != nil { 212 c.EnablePreimageRecording = *dec.EnablePreimageRecording 213 } 214 if dec.DocRoot != nil { 215 c.DocRoot = *dec.DocRoot 216 } 217 if dec.EWASMInterpreter != nil { 218 c.EWASMInterpreter = *dec.EWASMInterpreter 219 } 220 if dec.EVMInterpreter != nil { 221 c.EVMInterpreter = *dec.EVMInterpreter 222 } 223 if dec.RPCGasCap != nil { 224 c.RPCGasCap = dec.RPCGasCap 225 } 226 if dec.Checkpoint != nil { 227 c.Checkpoint = dec.Checkpoint 228 } 229 if dec.CheckpointOracle != nil { 230 c.CheckpointOracle = dec.CheckpointOracle 231 } 232 if dec.OverrideIstanbul != nil { 233 c.OverrideIstanbul = dec.OverrideIstanbul 234 } 235 if dec.OverrideMuirGlacier != nil { 236 c.OverrideMuirGlacier = dec.OverrideMuirGlacier 237 } 238 return nil 239 }