From 0a1eeca41e6ba5920ba65d9b41654768299bc7e3 Mon Sep 17 00:00:00 2001 From: obscuren Date: Wed, 18 Mar 2015 13:00:01 +0100 Subject: conversions. -compilable- --- cmd/ethereum/admin.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'cmd/ethereum/admin.go') diff --git a/cmd/ethereum/admin.go b/cmd/ethereum/admin.go index 880a22c22..967af2553 100644 --- a/cmd/ethereum/admin.go +++ b/cmd/ethereum/admin.go @@ -8,8 +8,8 @@ import ( "time" "github.com/ethereum/go-ethereum/cmd/utils" - "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/rlp" "github.com/ethereum/go-ethereum/rpc" "github.com/ethereum/go-ethereum/state" @@ -239,7 +239,7 @@ func (js *jsre) dumpBlock(call otto.FunctionCall) otto.Value { block = js.ethereum.ChainManager().GetBlockByNumber(uint64(num)) } else if call.Argument(0).IsString() { hash, _ := call.Argument(0).ToString() - block = js.ethereum.ChainManager().GetBlock(common.Hex2Bytes(hash)) + block = js.ethereum.ChainManager().GetBlock(common.HexToHash(hash)) } else { fmt.Println("invalid argument for dump. Either hex string or number") } -- cgit v1.2.3 From 064279c0ec2f048cbdd965c095ea332bb8666f94 Mon Sep 17 00:00:00 2001 From: Felix Lange Date: Wed, 18 Mar 2015 14:04:19 +0100 Subject: cmd/ethereum, cmd/utils: partial fix for chain import --- cmd/ethereum/admin.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'cmd/ethereum/admin.go') diff --git a/cmd/ethereum/admin.go b/cmd/ethereum/admin.go index 967af2553..41aaf46d8 100644 --- a/cmd/ethereum/admin.go +++ b/cmd/ethereum/admin.go @@ -221,13 +221,10 @@ func (js *jsre) exportChain(call otto.FunctionCall) otto.Value { fmt.Println(err) return otto.FalseValue() } - - data := js.ethereum.ChainManager().Export() - if err := common.WriteFile(fn, data); err != nil { + if err := utils.ExportChain(js.ethereum.ChainManager(), fn); err != nil { fmt.Println(err) return otto.FalseValue() } - return otto.TrueValue() } -- cgit v1.2.3