aboutsummaryrefslogtreecommitdiffstats
path: root/rpc/api/admin.go
diff options
context:
space:
mode:
authorzelig <viktor.tron@gmail.com>2015-10-27 05:24:09 +0800
committerzelig <viktor.tron@gmail.com>2015-10-27 05:24:09 +0800
commit4d005a2c1d2929dc770acd3a2bfed59495c70557 (patch)
tree0442ccefd85cc8b692c2c58a5916bc997909657a /rpc/api/admin.go
parent3b4ffacd0c63952ceda96b3fafb050c91e72b420 (diff)
downloaddexon-4d005a2c1d2929dc770acd3a2bfed59495c70557.tar
dexon-4d005a2c1d2929dc770acd3a2bfed59495c70557.tar.gz
dexon-4d005a2c1d2929dc770acd3a2bfed59495c70557.tar.bz2
dexon-4d005a2c1d2929dc770acd3a2bfed59495c70557.tar.lz
dexon-4d005a2c1d2929dc770acd3a2bfed59495c70557.tar.xz
dexon-4d005a2c1d2929dc770acd3a2bfed59495c70557.tar.zst
dexon-4d005a2c1d2929dc770acd3a2bfed59495c70557.zip
rpc api: eth_getNatSpec
* xeth, rpc: implement eth_getNatSpec for tx confirmations * rename silly docserver -> httpclient * eth/backend: httpclient now accessible via eth.Ethereum init-d via config.DocRoot * cmd: introduce separate CLI flag for DocRoot (defaults to homedir) * common/path: delete unused assetpath func, separate HomeDir func
Diffstat (limited to 'rpc/api/admin.go')
-rw-r--r--rpc/api/admin.go13
1 files changed, 4 insertions, 9 deletions
diff --git a/rpc/api/admin.go b/rpc/api/admin.go
index eed8d8366..eb08fbc5d 100644
--- a/rpc/api/admin.go
+++ b/rpc/api/admin.go
@@ -25,7 +25,6 @@ import (
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/compiler"
- "github.com/ethereum/go-ethereum/common/docserver"
"github.com/ethereum/go-ethereum/common/natspec"
"github.com/ethereum/go-ethereum/common/registrar"
"github.com/ethereum/go-ethereum/core"
@@ -84,19 +83,15 @@ type adminApi struct {
ethereum *eth.Ethereum
codec codec.Codec
coder codec.ApiCoder
- docRoot string
- ds *docserver.DocServer
}
// create a new admin api instance
-func NewAdminApi(xeth *xeth.XEth, ethereum *eth.Ethereum, codec codec.Codec, docRoot string) *adminApi {
+func NewAdminApi(xeth *xeth.XEth, ethereum *eth.Ethereum, codec codec.Codec) *adminApi {
return &adminApi{
xeth: xeth,
ethereum: ethereum,
codec: codec,
coder: codec.New(nil),
- docRoot: docRoot,
- ds: docserver.New(docRoot),
}
}
@@ -258,7 +253,7 @@ func (self *adminApi) StartRPC(req *shared.Request) (interface{}, error) {
CorsDomain: args.CorsDomain,
}
- apis, err := ParseApiString(args.Apis, self.codec, self.xeth, self.ethereum, self.docRoot)
+ apis, err := ParseApiString(args.Apis, self.codec, self.xeth, self.ethereum)
if err != nil {
return false, err
}
@@ -439,7 +434,7 @@ func (self *adminApi) GetContractInfo(req *shared.Request) (interface{}, error)
return nil, shared.NewDecodeParamError(err.Error())
}
- infoDoc, err := natspec.FetchDocsForContract(args.Contract, self.xeth, self.ds)
+ infoDoc, err := natspec.FetchDocsForContract(args.Contract, self.xeth, self.ethereum.HTTPClient())
if err != nil {
return nil, err
}
@@ -459,7 +454,7 @@ func (self *adminApi) HttpGet(req *shared.Request) (interface{}, error) {
return nil, shared.NewDecodeParamError(err.Error())
}
- resp, err := self.ds.Get(args.Uri, args.Path)
+ resp, err := self.ethereum.HTTPClient().Get(args.Uri, args.Path)
if err != nil {
return nil, err
}