Commit e58ba2fc authored by obscuren's avatar obscuren

Merge branch 'develop' of github.com-obscure:ethereum/eth-go into develop

parents 9dae1a17 0c55a113
...@@ -6,6 +6,7 @@ import ( ...@@ -6,6 +6,7 @@ import (
"github.com/ethereum/eth-go/ethpub" "github.com/ethereum/eth-go/ethpub"
"github.com/ethereum/eth-go/ethutil" "github.com/ethereum/eth-go/ethutil"
"math/big" "math/big"
"strings"
) )
type EthereumApi struct { type EthereumApi struct {
...@@ -174,9 +175,15 @@ func (p *EthereumApi) GetStorageAt(args *GetStorageArgs, reply *string) error { ...@@ -174,9 +175,15 @@ func (p *EthereumApi) GetStorageAt(args *GetStorageArgs, reply *string) error {
return err return err
} }
state := p.ethp.GetStateObject(args.Address) state := p.ethp.GetStateObject(args.Address)
// Convert the incoming string (which is a bigint) into hex
i, _ := new(big.Int).SetString(args.Key, 10) var hx string
hx := ethutil.Hex(i.Bytes()) if strings.Index(args.Key, "0x") == 0 {
hx = string([]byte(args.Key)[2:])
} else {
// 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) value := state.GetStorage(hx)
*reply = NewSuccessRes(GetStorageAtRes{Address: args.Address, Key: args.Key, Value: value}) *reply = NewSuccessRes(GetStorageAtRes{Address: args.Address, Key: args.Key, Value: value})
return nil return nil
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment