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