Moved ethutil => common

This commit is contained in:
obscuren
2015-03-16 11:27:38 +01:00
parent 0b8f66ed9e
commit b523441361
116 changed files with 610 additions and 604 deletions

View File

@@ -7,7 +7,7 @@ import (
"github.com/ethereum/go-ethereum/cmd/utils"
"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/tests"
)
@@ -41,7 +41,7 @@ func runblocktest(ctx *cli.Context) {
}
cfg := utils.MakeEthConfig(ClientIdentifier, Version, ctx)
cfg.NewDB = func(path string) (ethutil.Database, error) { return ethdb.NewMemDatabase() }
cfg.NewDB = func(path string) (common.Database, error) { return ethdb.NewMemDatabase() }
ethereum, err := eth.New(cfg)
if err != nil {
utils.Fatalf("%v", err)

View File

@@ -27,7 +27,7 @@ import (
"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/javascript"
"github.com/ethereum/go-ethereum/state"
"github.com/ethereum/go-ethereum/xeth"
@@ -226,7 +226,7 @@ func (self *jsre) dump(call otto.FunctionCall) otto.Value {
block = self.ethereum.ChainManager().GetBlockByNumber(uint64(num))
} else if call.Argument(0).IsString() {
hash, _ := call.Argument(0).ToString()
block = self.ethereum.ChainManager().GetBlock(ethutil.Hex2Bytes(hash))
block = self.ethereum.ChainManager().GetBlock(common.Hex2Bytes(hash))
} else {
fmt.Println("invalid argument for dump. Either hex string or number")
}
@@ -285,7 +285,7 @@ func (self *jsre) export(call otto.FunctionCall) otto.Value {
data := self.ethereum.ChainManager().Export()
if err := ethutil.WriteFile(fn, data); err != nil {
if err := common.WriteFile(fn, data); err != nil {
fmt.Println(err)
return otto.FalseValue()
}

View File

@@ -33,7 +33,7 @@ import (
"github.com/ethereum/go-ethereum/cmd/utils"
"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/state"
"github.com/peterh/liner"
@@ -200,7 +200,7 @@ func startEth(ctx *cli.Context, eth *eth.Ethereum) {
}
am := eth.AccountManager()
// Attempt to unlock the account
err := am.Unlock(ethutil.FromHex(split[0]), split[1])
err := am.Unlock(common.FromHex(split[0]), split[1])
if err != nil {
utils.Fatalf("Unlock account failed '%v'", err)
}
@@ -284,7 +284,7 @@ func dump(ctx *cli.Context) {
for _, arg := range ctx.Args() {
var block *types.Block
if hashish(arg) {
block = chainmgr.GetBlock(ethutil.Hex2Bytes(arg))
block = chainmgr.GetBlock(common.Hex2Bytes(arg))
} else {
num, _ := strconv.Atoi(arg)
block = chainmgr.GetBlockByNumber(uint64(num))