aboutsummaryrefslogtreecommitdiffstats
path: root/cmd/utils
diff options
context:
space:
mode:
authorzelig <viktor.tron@gmail.com>2015-03-16 23:46:29 +0800
committerzelig <viktor.tron@gmail.com>2015-03-16 23:46:29 +0800
commit5e7702fd050ed5520a03cc2cfc8b1f45a70f35fb (patch)
treed5ba6197a8c0c8e36bb92ee9fc8aad717cb2d178 /cmd/utils
parent8393dab470c40678caf36ada82e312d29c4cf5c4 (diff)
parent22893b7ac925c49168c119f293ea8befc3aff5cc (diff)
downloaddexon-5e7702fd050ed5520a03cc2cfc8b1f45a70f35fb.tar.gz
dexon-5e7702fd050ed5520a03cc2cfc8b1f45a70f35fb.tar.zst
dexon-5e7702fd050ed5520a03cc2cfc8b1f45a70f35fb.zip
Merge remote-tracking branch 'upstream/develop' into frontier/js
Conflicts: cmd/ethereum/js.go javascript/types.go
Diffstat (limited to 'cmd/utils')
-rw-r--r--cmd/utils/cmd.go10
-rw-r--r--cmd/utils/flags.go8
2 files changed, 9 insertions, 9 deletions
diff --git a/cmd/utils/cmd.go b/cmd/utils/cmd.go
index 6b99b841f..74fd5334e 100644
--- a/cmd/utils/cmd.go
+++ b/cmd/utils/cmd.go
@@ -30,7 +30,7 @@ import (
"github.com/ethereum/go-ethereum/core"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/eth"
- "github.com/ethereum/go-ethereum/ethutil"
+ "github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/logger"
"github.com/ethereum/go-ethereum/rlp"
)
@@ -62,7 +62,7 @@ func RunInterruptCallbacks(sig os.Signal) {
}
func openLogFile(Datadir string, filename string) *os.File {
- path := ethutil.AbsolutePath(Datadir, filename)
+ path := common.AbsolutePath(Datadir, filename)
file, err := os.OpenFile(path, os.O_RDWR|os.O_CREATE|os.O_APPEND, 0666)
if err != nil {
panic(fmt.Sprintf("error opening log file '%s': %v", filename, err))
@@ -132,10 +132,10 @@ func StartEthereumForTest(ethereum *eth.Ethereum) {
}
func FormatTransactionData(data string) []byte {
- d := ethutil.StringToByteFunc(data, func(s string) (ret []byte) {
+ d := common.StringToByteFunc(data, func(s string) (ret []byte) {
slice := regexp.MustCompile("\\n|\\s").Split(s, 1000000000)
for _, dataItem := range slice {
- d := ethutil.FormatData(dataItem)
+ d := common.FormatData(dataItem)
ret = append(ret, d...)
}
return
@@ -171,7 +171,7 @@ func ExportChain(chainmgr *core.ChainManager, fn string) error {
data := chainmgr.Export()
- if err := ethutil.WriteFile(fn, data); err != nil {
+ if err := common.WriteFile(fn, data); err != nil {
return err
}
fmt.Printf("exported blockchain\n")
diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go
index 563654441..42256903e 100644
--- a/cmd/utils/flags.go
+++ b/cmd/utils/flags.go
@@ -15,7 +15,7 @@ import (
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/eth"
"github.com/ethereum/go-ethereum/ethdb"
- "github.com/ethereum/go-ethereum/ethutil"
+ "github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/event"
"github.com/ethereum/go-ethereum/logger"
"github.com/ethereum/go-ethereum/p2p/nat"
@@ -87,7 +87,7 @@ var (
DataDirFlag = cli.StringFlag{
Name: "datadir",
Usage: "Data directory to be used",
- Value: ethutil.DefaultDataDir(),
+ Value: common.DefaultDataDir(),
}
MinerThreadsFlag = cli.IntFlag{
Name: "minerthreads",
@@ -198,7 +198,7 @@ func GetNodeKey(ctx *cli.Context) (key *ecdsa.PrivateKey) {
func MakeEthConfig(clientID, version string, ctx *cli.Context) *eth.Config {
return &eth.Config{
- Name: ethutil.MakeName(clientID, version),
+ Name: common.MakeName(clientID, version),
DataDir: ctx.GlobalString(DataDirFlag.Name),
LogFile: ctx.GlobalString(LogFileFlag.Name),
LogLevel: ctx.GlobalInt(LogLevelFlag.Name),
@@ -216,7 +216,7 @@ func MakeEthConfig(clientID, version string, ctx *cli.Context) *eth.Config {
}
}
-func GetChain(ctx *cli.Context) (*core.ChainManager, ethutil.Database, ethutil.Database) {
+func GetChain(ctx *cli.Context) (*core.ChainManager, common.Database, common.Database) {
dataDir := ctx.GlobalString(DataDirFlag.Name)
blockDb, err := ethdb.NewLDBDatabase(path.Join(dataDir, "blockchain"))
if err != nil {