diff options
author | Maran <maran.hidskes@gmail.com> | 2014-05-06 23:04:52 +0800 |
---|---|---|
committer | Maran <maran.hidskes@gmail.com> | 2014-05-06 23:04:52 +0800 |
commit | 050684450befaac8972120688b69825e8f0acbca (patch) | |
tree | 533de575821e119b2df953847a567e381a576f82 | |
parent | e18b96b486abefb587fd93cfe33fe6edcd8cbb87 (diff) | |
download | go-tangerine-050684450befaac8972120688b69825e8f0acbca.tar go-tangerine-050684450befaac8972120688b69825e8f0acbca.tar.gz go-tangerine-050684450befaac8972120688b69825e8f0acbca.tar.bz2 go-tangerine-050684450befaac8972120688b69825e8f0acbca.tar.lz go-tangerine-050684450befaac8972120688b69825e8f0acbca.tar.xz go-tangerine-050684450befaac8972120688b69825e8f0acbca.tar.zst go-tangerine-050684450befaac8972120688b69825e8f0acbca.zip |
Assume arguments are supplied as strings to the rpc interface
-rw-r--r-- | ethrpc/packages.go | 8 |
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 } |