github.com/intfoundation/intchain@v0.0.0-20220727031208-4316ad31ca73/intprotocol/gen_config.go (about) 1 // Code generated by github.com/fjl/gencodec. DO NOT EDIT. 2 3 package intprotocol 4 5 import ( 6 "math/big" 7 8 "github.com/intfoundation/intchain/common" 9 "github.com/intfoundation/intchain/common/hexutil" 10 "github.com/intfoundation/intchain/core" 11 "github.com/intfoundation/intchain/intprotocol/downloader" 12 "github.com/intfoundation/intchain/intprotocol/gasprice" 13 ) 14 15 var _ = (*configMarshaling)(nil) 16 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 LightServ int `toml:",omitempty"` 23 LightPeers int `toml:",omitempty"` 24 SkipBcVersionCheck bool `toml:"-"` 25 DatabaseHandles int `toml:"-"` 26 DatabaseCache int 27 Coinbase common.Address `toml:",omitempty"` 28 ExtraData hexutil.Bytes `toml:",omitempty"` 29 MinerGasFloor uint64 30 MinerGasCeil uint64 31 MinerGasPrice *big.Int 32 TxPool core.TxPoolConfig 33 GPO gasprice.Config 34 EnablePreimageRecording bool 35 DocRoot string `toml:"-"` 36 } 37 var enc Config 38 enc.Genesis = c.Genesis 39 enc.NetworkId = c.NetworkId 40 enc.SyncMode = c.SyncMode 41 enc.SkipBcVersionCheck = c.SkipBcVersionCheck 42 enc.DatabaseHandles = c.DatabaseHandles 43 enc.DatabaseCache = c.DatabaseCache 44 enc.Coinbase = c.Coinbase 45 enc.ExtraData = c.ExtraData 46 enc.MinerGasFloor = c.MinerGasFloor 47 enc.MinerGasCeil = c.MinerGasCeil 48 enc.MinerGasPrice = c.MinerGasPrice 49 enc.TxPool = c.TxPool 50 enc.GPO = c.GPO 51 enc.EnablePreimageRecording = c.EnablePreimageRecording 52 enc.DocRoot = c.DocRoot 53 return &enc, nil 54 } 55 56 func (c *Config) UnmarshalTOML(unmarshal func(interface{}) error) error { 57 type Config struct { 58 Genesis *core.Genesis `toml:",omitempty"` 59 NetworkId *uint64 60 SyncMode *downloader.SyncMode 61 LightServ *int `toml:",omitempty"` 62 LightPeers *int `toml:",omitempty"` 63 SkipBcVersionCheck *bool `toml:"-"` 64 DatabaseHandles *int `toml:"-"` 65 DatabaseCache *int 66 Coinbase *common.Address `toml:",omitempty"` 67 ExtraData *hexutil.Bytes `toml:",omitempty"` 68 MinerGasFloor *uint64 69 MinerGasCeil *uint64 70 MinerGasPrice *big.Int 71 TxPool *core.TxPoolConfig 72 GPO *gasprice.Config 73 EnablePreimageRecording *bool 74 DocRoot *string `toml:"-"` 75 } 76 var dec Config 77 if err := unmarshal(&dec); err != nil { 78 return err 79 } 80 if dec.Genesis != nil { 81 c.Genesis = dec.Genesis 82 } 83 if dec.NetworkId != nil { 84 c.NetworkId = *dec.NetworkId 85 } 86 if dec.SyncMode != nil { 87 c.SyncMode = *dec.SyncMode 88 } 89 90 if dec.SkipBcVersionCheck != nil { 91 c.SkipBcVersionCheck = *dec.SkipBcVersionCheck 92 } 93 if dec.DatabaseHandles != nil { 94 c.DatabaseHandles = *dec.DatabaseHandles 95 } 96 if dec.DatabaseCache != nil { 97 c.DatabaseCache = *dec.DatabaseCache 98 } 99 if dec.Coinbase != nil { 100 c.Coinbase = *dec.Coinbase 101 } 102 if dec.ExtraData != nil { 103 c.ExtraData = *dec.ExtraData 104 } 105 if dec.MinerGasFloor != nil { 106 c.MinerGasFloor = *dec.MinerGasFloor 107 } 108 if dec.MinerGasCeil != nil { 109 c.MinerGasCeil = *dec.MinerGasCeil 110 } 111 if dec.MinerGasPrice != nil { 112 c.MinerGasPrice = dec.MinerGasPrice 113 } 114 115 if dec.TxPool != nil { 116 c.TxPool = *dec.TxPool 117 } 118 if dec.GPO != nil { 119 c.GPO = *dec.GPO 120 } 121 if dec.EnablePreimageRecording != nil { 122 c.EnablePreimageRecording = *dec.EnablePreimageRecording 123 } 124 125 if dec.DocRoot != nil { 126 c.DocRoot = *dec.DocRoot 127 } 128 return nil 129 }