From 4d005a2c1d2929dc770acd3a2bfed59495c70557 Mon Sep 17 00:00:00 2001 From: zelig Date: Mon, 26 Oct 2015 22:24:09 +0100 Subject: 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 --- rpc/api/admin.go | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) (limited to 'rpc/api/admin.go') 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 } -- cgit