github.com/aquanetwork/aquachain@v1.7.8/aqua/gen_config.go (about)

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