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