diff options
author | zelig <viktor.tron@gmail.com> | 2015-06-23 22:48:33 +0800 |
---|---|---|
committer | Jeffrey Wilcke <geffobscura@gmail.com> | 2015-07-07 16:43:31 +0800 |
commit | 83ee39448e0f23d42dff27bccde27f828afa3707 (patch) | |
tree | 429fa8f20a4bc017a58ffc4c7c0ed8596d1d206f /rpc/api/admin_args.go | |
parent | d764bd058457cd9eb91d205d1ac187d40c4866d6 (diff) | |
download | dexon-83ee39448e0f23d42dff27bccde27f828afa3707.tar dexon-83ee39448e0f23d42dff27bccde27f828afa3707.tar.gz dexon-83ee39448e0f23d42dff27bccde27f828afa3707.tar.bz2 dexon-83ee39448e0f23d42dff27bccde27f828afa3707.tar.lz dexon-83ee39448e0f23d42dff27bccde27f828afa3707.tar.xz dexon-83ee39448e0f23d42dff27bccde27f828afa3707.tar.zst dexon-83ee39448e0f23d42dff27bccde27f828afa3707.zip |
Registrar and contractInfo handling
* resolver -> common/registrar
* global registrar name registry interface
* add Call to resolver backend interface
* the hashReg and UrlHing contracts now initialised from global registry
* initialization of contracts uniform
* improve errors and more econsistent method names
* common/registrar/ethreg: versioned registrar
* integrate new naming and registrar in natspec
* js console api: setGlobalRegistrar, setHashReg, setUrlHint
* js test TestContract uses mining - tests fixed all pass
* eth/backend: allow PoW test mode (small ethash DAG)
* console jsre refers to resolver.abi/addr,
* cmd/geth/contracts.go moved to common/registrar
Diffstat (limited to 'rpc/api/admin_args.go')
-rw-r--r-- | rpc/api/admin_args.go | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/rpc/api/admin_args.go b/rpc/api/admin_args.go index 5437971ca..7aee5d678 100644 --- a/rpc/api/admin_args.go +++ b/rpc/api/admin_args.go @@ -147,3 +147,34 @@ func (args *StartRPCArgs) UnmarshalJSON(b []byte) (err error) { return nil } + +type SleepBlocksArgs struct { + N int64 + Timeout int64 +} + +func (args *SleepBlocksArgs) UnmarshalJSON(b []byte) (err error) { + var obj []interface{} + if err := json.Unmarshal(b, &obj); err != nil { + return shared.NewDecodeParamError(err.Error()) + } + + args.N = 1 + args.Timeout = 0 + if len(obj) >= 1 { + if n, ok := obj[0].(int64); ok { + args.N = n + } else { + return shared.NewInvalidTypeError("N", "not an integer") + } + } + + if len(obj) >= 2 { + if n, ok := obj[1].(int64); ok { + args.N = n + } else { + return shared.NewInvalidTypeError("Timeout", "not an integer") + } + } + return nil +} |