aboutsummaryrefslogtreecommitdiffstats
path: root/rpc/api/admin_args.go
diff options
context:
space:
mode:
authorBas van Kervel <bas@ethdev.com>2015-06-10 17:29:52 +0800
committerBas van Kervel <basvankervel@gmail.com>2015-06-11 20:01:41 +0800
commitbd38428f33b127e9c60d26127695e50c55798fcd (patch)
tree9bb838822fc3d1b28775f57223a30a243d4df9f2 /rpc/api/admin_args.go
parent87b62f75a7b9c15c17f3352f1b50ad88966e7070 (diff)
downloaddexon-bd38428f33b127e9c60d26127695e50c55798fcd.tar.gz
dexon-bd38428f33b127e9c60d26127695e50c55798fcd.tar.zst
dexon-bd38428f33b127e9c60d26127695e50c55798fcd.zip
cleanup of javascript API
Diffstat (limited to 'rpc/api/admin_args.go')
-rw-r--r--rpc/api/admin_args.go14
1 files changed, 2 insertions, 12 deletions
diff --git a/rpc/api/admin_args.go b/rpc/api/admin_args.go
index 9c0cbdcb6..56bb57e20 100644
--- a/rpc/api/admin_args.go
+++ b/rpc/api/admin_args.go
@@ -3,8 +3,6 @@ package api
import (
"encoding/json"
- "math/big"
-
"github.com/ethereum/go-ethereum/rpc/shared"
)
@@ -68,16 +66,8 @@ func (args *VerbosityArgs) UnmarshalJSON(b []byte) (err error) {
return shared.NewDecodeParamError("Expected enode as argument")
}
- if levelint, ok := obj[0].(int); ok {
- args.Level = levelint
- } else if levelstr, ok := obj[0].(string); ok {
- if !ok {
- return shared.NewInvalidTypeError("level", "not a string")
- }
- level, success := new(big.Int).SetString(levelstr, 0)
- if !success {
- return shared.NewDecodeParamError("Unable to parse verbosity level")
- }
+ level, err := numString(obj[0])
+ if err == nil {
args.Level = int(level.Int64())
}