aboutsummaryrefslogtreecommitdiffstats
path: root/rpc
diff options
context:
space:
mode:
authorTaylor Gerring <taylor.gerring@gmail.com>2015-03-20 08:00:41 +0800
committerTaylor Gerring <taylor.gerring@gmail.com>2015-03-20 08:00:41 +0800
commit7562bc1dbc23b0b8a384de29729ea24daa5c45a0 (patch)
tree25b7b63d61fa8d56df2eae40a98d2c9d27f1935b /rpc
parentb7745c683529bc60139d4af7fec2bf849928bfe7 (diff)
downloaddexon-7562bc1dbc23b0b8a384de29729ea24daa5c45a0.tar
dexon-7562bc1dbc23b0b8a384de29729ea24daa5c45a0.tar.gz
dexon-7562bc1dbc23b0b8a384de29729ea24daa5c45a0.tar.bz2
dexon-7562bc1dbc23b0b8a384de29729ea24daa5c45a0.tar.lz
dexon-7562bc1dbc23b0b8a384de29729ea24daa5c45a0.tar.xz
dexon-7562bc1dbc23b0b8a384de29729ea24daa5c45a0.tar.zst
dexon-7562bc1dbc23b0b8a384de29729ea24daa5c45a0.zip
inline GetBalance
Diffstat (limited to 'rpc')
-rw-r--r--rpc/api.go15
1 files changed, 6 insertions, 9 deletions
diff --git a/rpc/api.go b/rpc/api.go
index 54efd6005..5654ee3d3 100644
--- a/rpc/api.go
+++ b/rpc/api.go
@@ -282,14 +282,6 @@ func (p *EthereumApi) Call(args *NewTxArgs, reply *interface{}) error {
return nil
}
-func (p *EthereumApi) GetBalance(args *GetBalanceArgs, reply *interface{}) error {
- if err := args.requirements(); err != nil {
- return err
- }
- *reply = common.ToHex(p.xethWithStateNum(args.BlockNumber).State().SafeGet(args.Address).Balance().Bytes())
- return nil
-}
-
func (p *EthereumApi) GetStorage(args *GetStorageArgs, reply *interface{}) error {
if err := args.requirements(); err != nil {
return err
@@ -506,7 +498,12 @@ func (p *EthereumApi) GetRequestReply(req *RpcRequest, reply *interface{}) error
if err := json.Unmarshal(req.Params, &args); err != nil {
return err
}
- return p.GetBalance(args, reply)
+
+ if err := args.requirements(); err != nil {
+ return err
+ }
+
+ *reply = common.ToHex(p.xethWithStateNum(args.BlockNumber).State().SafeGet(args.Address).Balance().Bytes())
case "eth_getStorage", "eth_storageAt":
args := new(GetStorageArgs)
if err := json.Unmarshal(req.Params, &args); err != nil {