added miner API

This commit is contained in:
Bas van Kervel
2015-06-08 14:42:15 +02:00
committed by Bas van Kervel
parent cb7f2d43b6
commit 4b9b633dfe
5 changed files with 323 additions and 1 deletions

View File

@@ -23,6 +23,8 @@ func ParseApiString(apistr string, codec codec.Codec, xeth *xeth.XEth, eth *eth.
switch strings.ToLower(strings.TrimSpace(name)) {
case EthApiName:
apis[i] = NewEthApi(xeth, codec)
case MinerApiName:
apis[i] = NewMinerApi(eth, codec)
case Web3ApiName:
apis[i] = NewWeb3(xeth, codec)
default:
@@ -32,3 +34,12 @@ func ParseApiString(apistr string, codec codec.Codec, xeth *xeth.XEth, eth *eth.
return apis, nil
}
func Javascript(name string) string {
switch strings.ToLower(strings.TrimSpace(name)) {
case MinerApiName:
return Miner_JS
}
return ""
}