rpc: new RPC implementation with pub/sub support
This commit is contained in:
@@ -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
|
||||
|
@@ -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:
|
||||
|
@@ -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)
|
||||
}
|
||||
|
Reference in New Issue
Block a user