diff options
Diffstat (limited to 'eth')
-rw-r--r-- | eth/gen_config.go | 54 | ||||
-rw-r--r-- | eth/tracers/internal/tracers/assets.go | 40 |
2 files changed, 29 insertions, 65 deletions
diff --git a/eth/gen_config.go b/eth/gen_config.go index e2d50e1f6..92cab57e1 100644 --- a/eth/gen_config.go +++ b/eth/gen_config.go @@ -13,6 +13,8 @@ import ( "github.com/ethereum/go-ethereum/eth/gasprice" ) +var _ = (*configMarshaling)(nil) + func (c Config) MarshalTOML() (interface{}, error) { type Config struct { Genesis *core.Genesis `toml:",omitempty"` @@ -20,7 +22,6 @@ func (c Config) MarshalTOML() (interface{}, error) { SyncMode downloader.SyncMode LightServ int `toml:",omitempty"` LightPeers int `toml:",omitempty"` - MaxPeers int `toml:"-"` SkipBcVersionCheck bool `toml:"-"` DatabaseHandles int `toml:"-"` DatabaseCache int @@ -28,17 +29,11 @@ func (c Config) MarshalTOML() (interface{}, error) { MinerThreads int `toml:",omitempty"` ExtraData hexutil.Bytes `toml:",omitempty"` GasPrice *big.Int - EthashCacheDir string - EthashCachesInMem int - EthashCachesOnDisk int - EthashDatasetDir string - EthashDatasetsInMem int - EthashDatasetsOnDisk int + Ethash ethash.Config TxPool core.TxPoolConfig GPO gasprice.Config EnablePreimageRecording bool - DocRoot string `toml:"-"` - PowMode ethash.Mode `toml:"-"` + DocRoot string `toml:"-"` } var enc Config enc.Genesis = c.Genesis @@ -53,17 +48,11 @@ func (c Config) MarshalTOML() (interface{}, error) { enc.MinerThreads = c.MinerThreads enc.ExtraData = c.ExtraData enc.GasPrice = c.GasPrice - enc.EthashCacheDir = c.Ethash.CacheDir - enc.EthashCachesInMem = c.Ethash.CachesInMem - enc.EthashCachesOnDisk = c.Ethash.CachesOnDisk - enc.EthashDatasetDir = c.Ethash.DatasetDir - enc.EthashDatasetsInMem = c.Ethash.DatasetsInMem - enc.EthashDatasetsOnDisk = c.Ethash.DatasetsOnDisk + enc.Ethash = c.Ethash enc.TxPool = c.TxPool enc.GPO = c.GPO enc.EnablePreimageRecording = c.EnablePreimageRecording enc.DocRoot = c.DocRoot - enc.PowMode = c.Ethash.PowMode return &enc, nil } @@ -74,7 +63,6 @@ func (c *Config) UnmarshalTOML(unmarshal func(interface{}) error) error { SyncMode *downloader.SyncMode LightServ *int `toml:",omitempty"` LightPeers *int `toml:",omitempty"` - MaxPeers *int `toml:"-"` SkipBcVersionCheck *bool `toml:"-"` DatabaseHandles *int `toml:"-"` DatabaseCache *int @@ -82,17 +70,11 @@ func (c *Config) UnmarshalTOML(unmarshal func(interface{}) error) error { MinerThreads *int `toml:",omitempty"` ExtraData hexutil.Bytes `toml:",omitempty"` GasPrice *big.Int - EthashCacheDir *string - EthashCachesInMem *int - EthashCachesOnDisk *int - EthashDatasetDir *string - EthashDatasetsInMem *int - EthashDatasetsOnDisk *int + Ethash *ethash.Config TxPool *core.TxPoolConfig GPO *gasprice.Config EnablePreimageRecording *bool - DocRoot *string `toml:"-"` - PowMode *ethash.Mode `toml:"-"` + DocRoot *string `toml:"-"` } var dec Config if err := unmarshal(&dec); err != nil { @@ -134,23 +116,8 @@ func (c *Config) UnmarshalTOML(unmarshal func(interface{}) error) error { if dec.GasPrice != nil { c.GasPrice = dec.GasPrice } - if dec.EthashCacheDir != nil { - c.Ethash.CacheDir = *dec.EthashCacheDir - } - if dec.EthashCachesInMem != nil { - c.Ethash.CachesInMem = *dec.EthashCachesInMem - } - if dec.EthashCachesOnDisk != nil { - c.Ethash.CachesOnDisk = *dec.EthashCachesOnDisk - } - if dec.EthashDatasetDir != nil { - c.Ethash.DatasetDir = *dec.EthashDatasetDir - } - if dec.EthashDatasetsInMem != nil { - c.Ethash.DatasetsInMem = *dec.EthashDatasetsInMem - } - if dec.EthashDatasetsOnDisk != nil { - c.Ethash.DatasetsOnDisk = *dec.EthashDatasetsOnDisk + if dec.Ethash != nil { + c.Ethash = *dec.Ethash } if dec.TxPool != nil { c.TxPool = *dec.TxPool @@ -164,8 +131,5 @@ func (c *Config) UnmarshalTOML(unmarshal func(interface{}) error) error { if dec.DocRoot != nil { c.DocRoot = *dec.DocRoot } - if dec.PowMode != nil { - c.Ethash.PowMode = *dec.PowMode - } return nil } diff --git a/eth/tracers/internal/tracers/assets.go b/eth/tracers/internal/tracers/assets.go index cb0421008..1912f74ed 100644 --- a/eth/tracers/internal/tracers/assets.go +++ b/eth/tracers/internal/tracers/assets.go @@ -1,4 +1,4 @@ -// Code generated by go-bindata. +// Code generated by go-bindata. DO NOT EDIT. // sources: // 4byte_tracer.js // call_tracer.js @@ -6,7 +6,6 @@ // noop_tracer.js // opcount_tracer.js // prestate_tracer.js -// DO NOT EDIT! package tracers @@ -197,8 +196,8 @@ func prestate_tracerJs() (*asset, error) { // It returns an error if the asset could not be found or // could not be loaded. func Asset(name string) ([]byte, error) { - cannonicalName := strings.Replace(name, "\\", "/", -1) - if f, ok := _bindata[cannonicalName]; ok { + canonicalName := strings.Replace(name, "\\", "/", -1) + if f, ok := _bindata[canonicalName]; ok { a, err := f() if err != nil { return nil, fmt.Errorf("Asset %s can't read by error: %v", name, err) @@ -223,8 +222,8 @@ func MustAsset(name string) []byte { // It returns an error if the asset could not be found or // could not be loaded. func AssetInfo(name string) (os.FileInfo, error) { - cannonicalName := strings.Replace(name, "\\", "/", -1) - if f, ok := _bindata[cannonicalName]; ok { + canonicalName := strings.Replace(name, "\\", "/", -1) + if f, ok := _bindata[canonicalName]; ok { a, err := f() if err != nil { return nil, fmt.Errorf("AssetInfo %s can't read by error: %v", name, err) @@ -245,11 +244,16 @@ func AssetNames() []string { // _bindata is a table, holding each asset generator, mapped to its name. var _bindata = map[string]func() (*asset, error){ - "4byte_tracer.js": _4byte_tracerJs, - "call_tracer.js": call_tracerJs, - "evmdis_tracer.js": evmdis_tracerJs, - "noop_tracer.js": noop_tracerJs, - "opcount_tracer.js": opcount_tracerJs, + "4byte_tracer.js": _4byte_tracerJs, + + "call_tracer.js": call_tracerJs, + + "evmdis_tracer.js": evmdis_tracerJs, + + "noop_tracer.js": noop_tracerJs, + + "opcount_tracer.js": opcount_tracerJs, + "prestate_tracer.js": prestate_tracerJs, } @@ -269,8 +273,8 @@ var _bindata = map[string]func() (*asset, error){ func AssetDir(name string) ([]string, error) { node := _bintree if len(name) != 0 { - cannonicalName := strings.Replace(name, "\\", "/", -1) - pathList := strings.Split(cannonicalName, "/") + canonicalName := strings.Replace(name, "\\", "/", -1) + pathList := strings.Split(canonicalName, "/") for _, p := range pathList { node = node.Children[p] if node == nil { @@ -320,11 +324,7 @@ func RestoreAsset(dir, name string) error { if err != nil { return err } - err = os.Chtimes(_filePath(dir, name), info.ModTime(), info.ModTime()) - if err != nil { - return err - } - return nil + return os.Chtimes(_filePath(dir, name), info.ModTime(), info.ModTime()) } // RestoreAssets restores an asset under the given directory recursively @@ -345,6 +345,6 @@ func RestoreAssets(dir, name string) error { } func _filePath(dir, name string) string { - cannonicalName := strings.Replace(name, "\\", "/", -1) - return filepath.Join(append([]string{dir}, strings.Split(cannonicalName, "/")...)...) + canonicalName := strings.Replace(name, "\\", "/", -1) + return filepath.Join(append([]string{dir}, strings.Split(canonicalName, "/")...)...) } |