From 589d27386a4d630f052bf645a9e134a8b2d6fcad Mon Sep 17 00:00:00 2001 From: Maran Date: Wed, 25 Jun 2014 14:05:55 +0200 Subject: [PATCH] Fix key generation in ethPub --- ethpub/pub.go | 2 +- ethrpc/packages.go | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/ethpub/pub.go b/ethpub/pub.go index b475453af0..6a41f575cc 100644 --- a/ethpub/pub.go +++ b/ethpub/pub.go @@ -142,7 +142,7 @@ func (lib *PEthereum) createTx(key, recipient, valueStr, gasStr, gasPriceStr, sc var keyPair *ethutil.KeyPair var err error if key[0:2] == "0x" { - keyPair, err = ethutil.NewKeyPairFromSec([]byte(ethutil.FromHex(key[0:2]))) + keyPair, err = ethutil.NewKeyPairFromSec([]byte(ethutil.FromHex(key[2:]))) } else { keyPair, err = ethutil.NewKeyPairFromSec([]byte(ethutil.FromHex(key))) } diff --git a/ethrpc/packages.go b/ethrpc/packages.go index 34d7a3d6fb..3f57f69826 100644 --- a/ethrpc/packages.go +++ b/ethrpc/packages.go @@ -184,6 +184,7 @@ func (p *EthereumApi) GetStorageAt(args *GetStorageArgs, reply *string) error { i, _ := new(big.Int).SetString(args.Key, 10) hx = ethutil.Hex(i.Bytes()) } + ethutil.Config.Log.Debugf("[JSON] GetStorageAt(%s, %s)\n", args.Address, hx) value := state.GetStorage(hx) *reply = NewSuccessRes(GetStorageAtRes{Address: args.Address, Key: args.Key, Value: value}) return nil