github.com/theQRL/go-zond@v0.2.1/zond/zondconfig/gen_config.go (about) 1 // Code generated by github.com/fjl/gencodec. DO NOT EDIT. 2 3 package zondconfig 4 5 import ( 6 "time" 7 8 "github.com/theQRL/go-zond/common" 9 "github.com/theQRL/go-zond/core" 10 "github.com/theQRL/go-zond/core/txpool/legacypool" 11 "github.com/theQRL/go-zond/zond/downloader" 12 "github.com/theQRL/go-zond/zond/gasprice" 13 "github.com/theQRL/go-zond/miner" 14 ) 15 16 // MarshalTOML marshals as TOML. 17 func (c Config) MarshalTOML() (interface{}, error) { 18 type Config struct { 19 Genesis *core.Genesis `toml:",omitempty"` 20 NetworkId uint64 21 SyncMode downloader.SyncMode 22 ZondDiscoveryURLs []string 23 SnapDiscoveryURLs []string 24 NoPruning bool 25 NoPrefetch bool 26 TxLookupLimit uint64 `toml:",omitempty"` 27 TransactionHistory uint64 `toml:",omitempty"` 28 StateHistory uint64 `toml:",omitempty"` 29 StateScheme string `toml:",omitempty"` 30 RequiredBlocks map[uint64]common.Hash `toml:"-"` 31 SkipBcVersionCheck bool `toml:"-"` 32 DatabaseHandles int `toml:"-"` 33 DatabaseCache int 34 DatabaseFreezer string 35 TrieCleanCache int 36 TrieDirtyCache int 37 TrieTimeout time.Duration 38 SnapshotCache int 39 Preimages bool 40 FilterLogCacheSize int 41 Miner miner.Config 42 TxPool legacypool.Config 43 GPO gasprice.Config 44 EnablePreimageRecording bool 45 DocRoot string `toml:"-"` 46 RPCGasCap uint64 47 RPCZVMTimeout time.Duration 48 RPCTxFeeCap float64 49 } 50 var enc Config 51 enc.Genesis = c.Genesis 52 enc.NetworkId = c.NetworkId 53 enc.SyncMode = c.SyncMode 54 enc.ZondDiscoveryURLs = c.ZondDiscoveryURLs 55 enc.SnapDiscoveryURLs = c.SnapDiscoveryURLs 56 enc.NoPruning = c.NoPruning 57 enc.NoPrefetch = c.NoPrefetch 58 enc.TransactionHistory = c.TransactionHistory 59 enc.StateHistory = c.StateHistory 60 enc.StateScheme = c.StateScheme 61 enc.RequiredBlocks = c.RequiredBlocks 62 enc.SkipBcVersionCheck = c.SkipBcVersionCheck 63 enc.DatabaseHandles = c.DatabaseHandles 64 enc.DatabaseCache = c.DatabaseCache 65 enc.DatabaseFreezer = c.DatabaseFreezer 66 enc.TrieCleanCache = c.TrieCleanCache 67 enc.TrieDirtyCache = c.TrieDirtyCache 68 enc.TrieTimeout = c.TrieTimeout 69 enc.SnapshotCache = c.SnapshotCache 70 enc.Preimages = c.Preimages 71 enc.FilterLogCacheSize = c.FilterLogCacheSize 72 enc.Miner = c.Miner 73 enc.TxPool = c.TxPool 74 enc.GPO = c.GPO 75 enc.EnablePreimageRecording = c.EnablePreimageRecording 76 enc.DocRoot = c.DocRoot 77 enc.RPCGasCap = c.RPCGasCap 78 enc.RPCZVMTimeout = c.RPCZVMTimeout 79 enc.RPCTxFeeCap = c.RPCTxFeeCap 80 return &enc, nil 81 } 82 83 // UnmarshalTOML unmarshals from TOML. 84 func (c *Config) UnmarshalTOML(unmarshal func(interface{}) error) error { 85 type Config struct { 86 Genesis *core.Genesis `toml:",omitempty"` 87 NetworkId *uint64 88 SyncMode *downloader.SyncMode 89 ZondDiscoveryURLs []string 90 SnapDiscoveryURLs []string 91 NoPruning *bool 92 NoPrefetch *bool 93 TxLookupLimit *uint64 `toml:",omitempty"` 94 TransactionHistory *uint64 `toml:",omitempty"` 95 StateHistory *uint64 `toml:",omitempty"` 96 StateScheme *string `toml:",omitempty"` 97 RequiredBlocks map[uint64]common.Hash `toml:"-"` 98 SkipBcVersionCheck *bool `toml:"-"` 99 DatabaseHandles *int `toml:"-"` 100 DatabaseCache *int 101 DatabaseFreezer *string 102 TrieCleanCache *int 103 TrieDirtyCache *int 104 TrieTimeout *time.Duration 105 SnapshotCache *int 106 Preimages *bool 107 FilterLogCacheSize *int 108 Miner *miner.Config 109 TxPool *legacypool.Config 110 GPO *gasprice.Config 111 EnablePreimageRecording *bool 112 DocRoot *string `toml:"-"` 113 RPCGasCap *uint64 114 RPCZVMTimeout *time.Duration 115 RPCTxFeeCap *float64 116 } 117 var dec Config 118 if err := unmarshal(&dec); err != nil { 119 return err 120 } 121 if dec.Genesis != nil { 122 c.Genesis = dec.Genesis 123 } 124 if dec.NetworkId != nil { 125 c.NetworkId = *dec.NetworkId 126 } 127 if dec.SyncMode != nil { 128 c.SyncMode = *dec.SyncMode 129 } 130 if dec.ZondDiscoveryURLs != nil { 131 c.ZondDiscoveryURLs = dec.ZondDiscoveryURLs 132 } 133 if dec.SnapDiscoveryURLs != nil { 134 c.SnapDiscoveryURLs = dec.SnapDiscoveryURLs 135 } 136 if dec.NoPruning != nil { 137 c.NoPruning = *dec.NoPruning 138 } 139 if dec.NoPrefetch != nil { 140 c.NoPrefetch = *dec.NoPrefetch 141 } 142 if dec.TransactionHistory != nil { 143 c.TransactionHistory = *dec.TransactionHistory 144 } 145 if dec.StateHistory != nil { 146 c.StateHistory = *dec.StateHistory 147 } 148 if dec.StateScheme != nil { 149 c.StateScheme = *dec.StateScheme 150 } 151 if dec.RequiredBlocks != nil { 152 c.RequiredBlocks = dec.RequiredBlocks 153 } 154 if dec.SkipBcVersionCheck != nil { 155 c.SkipBcVersionCheck = *dec.SkipBcVersionCheck 156 } 157 if dec.DatabaseHandles != nil { 158 c.DatabaseHandles = *dec.DatabaseHandles 159 } 160 if dec.DatabaseCache != nil { 161 c.DatabaseCache = *dec.DatabaseCache 162 } 163 if dec.DatabaseFreezer != nil { 164 c.DatabaseFreezer = *dec.DatabaseFreezer 165 } 166 if dec.TrieCleanCache != nil { 167 c.TrieCleanCache = *dec.TrieCleanCache 168 } 169 if dec.TrieDirtyCache != nil { 170 c.TrieDirtyCache = *dec.TrieDirtyCache 171 } 172 if dec.TrieTimeout != nil { 173 c.TrieTimeout = *dec.TrieTimeout 174 } 175 if dec.SnapshotCache != nil { 176 c.SnapshotCache = *dec.SnapshotCache 177 } 178 if dec.Preimages != nil { 179 c.Preimages = *dec.Preimages 180 } 181 if dec.FilterLogCacheSize != nil { 182 c.FilterLogCacheSize = *dec.FilterLogCacheSize 183 } 184 if dec.Miner != nil { 185 c.Miner = *dec.Miner 186 } 187 if dec.TxPool != nil { 188 c.TxPool = *dec.TxPool 189 } 190 if dec.GPO != nil { 191 c.GPO = *dec.GPO 192 } 193 if dec.EnablePreimageRecording != nil { 194 c.EnablePreimageRecording = *dec.EnablePreimageRecording 195 } 196 if dec.DocRoot != nil { 197 c.DocRoot = *dec.DocRoot 198 } 199 if dec.RPCGasCap != nil { 200 c.RPCGasCap = *dec.RPCGasCap 201 } 202 if dec.RPCZVMTimeout != nil { 203 c.RPCZVMTimeout = *dec.RPCZVMTimeout 204 } 205 if dec.RPCTxFeeCap != nil { 206 c.RPCTxFeeCap = *dec.RPCTxFeeCap 207 } 208 return nil 209 }