aboutsummaryrefslogtreecommitdiffstats
path: root/rpc/api
diff options
context:
space:
mode:
authorFelix Lange <fjl@twurst.com>2015-12-15 00:38:10 +0800
committerFelix Lange <fjl@twurst.com>2015-12-15 00:38:10 +0800
commitfa187a366dda1894179635eeec2a929bfacc4ad3 (patch)
tree4494d4dcded47dd49f2fe7374e85fefa9249246e /rpc/api
parent787d71d6595df98586c625e82f4decb034215203 (diff)
parenteae81465c1c815c317cd30e4de6bdf4d59df2340 (diff)
downloaddexon-fa187a366dda1894179635eeec2a929bfacc4ad3.tar
dexon-fa187a366dda1894179635eeec2a929bfacc4ad3.tar.gz
dexon-fa187a366dda1894179635eeec2a929bfacc4ad3.tar.bz2
dexon-fa187a366dda1894179635eeec2a929bfacc4ad3.tar.lz
dexon-fa187a366dda1894179635eeec2a929bfacc4ad3.tar.xz
dexon-fa187a366dda1894179635eeec2a929bfacc4ad3.tar.zst
dexon-fa187a366dda1894179635eeec2a929bfacc4ad3.zip
Merge pull request #2035 from bas-vk/rcp-v2-rebase
rpc: new RPC implementation with pub/sub support
Diffstat (limited to 'rpc/api')
-rw-r--r--rpc/api/mergedapi.go8
-rw-r--r--rpc/api/personal_js.go5
-rw-r--r--rpc/api/utils.go2
3 files changed, 12 insertions, 3 deletions
diff --git a/rpc/api/mergedapi.go b/rpc/api/mergedapi.go
index 8f4ef8e60..92e1e2bb7 100644
--- a/rpc/api/mergedapi.go
+++ b/rpc/api/mergedapi.go
@@ -39,9 +39,11 @@ func newMergedApi(apis ...shared.EthereumApi) *MergedApi {
mergedApi.methods = make(map[string]shared.EthereumApi)
for _, api := range apis {
- mergedApi.apis[api.Name()] = api.ApiVersion()
- for _, method := range api.Methods() {
- mergedApi.methods[method] = api
+ if api != nil {
+ mergedApi.apis[api.Name()] = api.ApiVersion()
+ for _, method := range api.Methods() {
+ mergedApi.methods[method] = api
+ }
}
}
return mergedApi
diff --git a/rpc/api/personal_js.go b/rpc/api/personal_js.go
index 81c5d4a36..84c669af7 100644
--- a/rpc/api/personal_js.go
+++ b/rpc/api/personal_js.go
@@ -33,6 +33,11 @@ web3._extend({
call: 'personal_unlockAccount',
params: 3,
inputFormatter: [null, null, null]
+ }),
+ new web3._extend.Method({
+ name: 'lockAccount',
+ call: 'personal_lockAccount',
+ params: 1
})
],
properties:
diff --git a/rpc/api/utils.go b/rpc/api/utils.go
index d6820cd2e..794b6abee 100644
--- a/rpc/api/utils.go
+++ b/rpc/api/utils.go
@@ -191,6 +191,8 @@ func ParseApiString(apistr string, codec codec.Codec, xeth *xeth.XEth, stack *no
apis[i] = NewPersonalApi(xeth, eth, codec)
case shared.Web3ApiName:
apis[i] = NewWeb3Api(xeth, codec)
+ case "rpc": // gives information about the RPC interface
+ continue
default:
return nil, fmt.Errorf("Unknown API '%s'", name)
}