aboutsummaryrefslogtreecommitdiffstats
path: root/ethrpc/packages.go
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2014-05-10 08:04:06 +0800
committerobscuren <geffobscura@gmail.com>2014-05-10 08:04:06 +0800
commit3af35d922e5751dcf265d31abf293b759e570fec (patch)
tree5dbfdb50177d9c7ededabb240f7e792d1174505b /ethrpc/packages.go
parent2096b3a9edb3289a8f30da81704181dec7b39917 (diff)
parentdbf8645aafb19837d01b939ba9b1d3e1a2fffbf9 (diff)
downloaddexon-3af35d922e5751dcf265d31abf293b759e570fec.tar
dexon-3af35d922e5751dcf265d31abf293b759e570fec.tar.gz
dexon-3af35d922e5751dcf265d31abf293b759e570fec.tar.bz2
dexon-3af35d922e5751dcf265d31abf293b759e570fec.tar.lz
dexon-3af35d922e5751dcf265d31abf293b759e570fec.tar.xz
dexon-3af35d922e5751dcf265d31abf293b759e570fec.tar.zst
dexon-3af35d922e5751dcf265d31abf293b759e570fec.zip
Merge branch 'release/poc5-rc2'
Diffstat (limited to 'ethrpc/packages.go')
-rw-r--r--ethrpc/packages.go8
1 files changed, 6 insertions, 2 deletions
diff --git a/ethrpc/packages.go b/ethrpc/packages.go
index b989a65cb..4ec2b4602 100644
--- a/ethrpc/packages.go
+++ b/ethrpc/packages.go
@@ -4,7 +4,8 @@ import (
"encoding/json"
"errors"
"github.com/ethereum/eth-go/ethpub"
- _ "log"
+ "github.com/ethereum/eth-go/ethutil"
+ "math/big"
)
type EthereumApi struct {
@@ -173,7 +174,10 @@ func (p *EthereumApi) GetStorageAt(args *GetStorageArgs, reply *string) error {
return err
}
state := p.ethp.GetStateObject(args.Address)
- value := state.GetStorage(args.Key)
+ // Convert the incoming string (which is a bigint) into hex
+ i, _ := new(big.Int).SetString(args.Key, 10)
+ hx := ethutil.Hex(i.Bytes())
+ value := state.GetStorage(hx)
*reply = NewSuccessRes(GetStorageAtRes{Address: args.Address, Key: args.Key, Value: value})
return nil
}