diff options
Diffstat (limited to 'rpc/api.go')
-rw-r--r-- | rpc/api.go | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/rpc/api.go b/rpc/api.go index b554dc16b..5e27890ce 100644 --- a/rpc/api.go +++ b/rpc/api.go @@ -80,8 +80,9 @@ func (api *EthereumApi) GetRequestReply(req *RpcRequest, reply *interface{}) err return err } - v := api.xethAtStateNum(args.BlockNumber).State().SafeGet(args.Address).Balance() - *reply = common.ToHex(v.Bytes()) + *reply = api.xethAtStateNum(args.BlockNumber).BalanceAt(args.Address) + //v := api.xethAtStateNum(args.BlockNumber).State().SafeGet(args.Address).Balance() + //*reply = common.ToHex(v.Bytes()) case "eth_getStorage", "eth_storageAt": args := new(GetStorageArgs) if err := json.Unmarshal(req.Params, &args); err != nil { @@ -95,10 +96,7 @@ func (api *EthereumApi) GetRequestReply(req *RpcRequest, reply *interface{}) err return err } - state := api.xethAtStateNum(args.BlockNumber).State().SafeGet(args.Address) - value := state.StorageString(args.Key) - - *reply = common.ToHex(value.Bytes()) + *reply = api.xethAtStateNum(args.BlockNumber).StorageAt(args.Address, args.Key) case "eth_getTransactionCount": args := new(GetTxCountArgs) if err := json.Unmarshal(req.Params, &args); err != nil { |