@@ -30,7 +30,6 @@ import (
3030
3131 "github.com/ethereum/go-ethereum/cmd/utils"
3232 "github.com/ethereum/go-ethereum/common"
33- "github.com/ethereum/go-ethereum/common/docserver"
3433 "github.com/ethereum/go-ethereum/common/natspec"
3534 "github.com/ethereum/go-ethereum/common/registrar"
3635 "github.com/ethereum/go-ethereum/eth"
@@ -77,8 +76,6 @@ func (r dumbterm) PasswordPrompt(p string) (string, error) {
7776func (r dumbterm ) AppendHistory (string ) {}
7877
7978type jsre struct {
80- docRoot string
81- ds * docserver.DocServer
8279 re * re.JSRE
8380 ethereum * eth.Ethereum
8481 xeth * xeth.XEth
@@ -153,7 +150,6 @@ func newLightweightJSRE(docRoot string, client comms.EthereumClient, datadir str
153150 js := & jsre {ps1 : "> " }
154151 js .wait = make (chan * big.Int )
155152 js .client = client
156- js .ds = docserver .New (docRoot )
157153
158154 // update state in separare forever blocks
159155 js .re = re .New (docRoot )
@@ -181,18 +177,17 @@ func newLightweightJSRE(docRoot string, client comms.EthereumClient, datadir str
181177}
182178
183179func newJSRE (ethereum * eth.Ethereum , docRoot , corsDomain string , client comms.EthereumClient , interactive bool , f xeth.Frontend ) * jsre {
184- js := & jsre {ethereum : ethereum , ps1 : "> " , docRoot : docRoot }
180+ js := & jsre {ethereum : ethereum , ps1 : "> " }
185181 // set default cors domain used by startRpc from CLI flag
186182 js .corsDomain = corsDomain
187183 if f == nil {
188184 f = js
189185 }
190- js .ds = docserver .New (docRoot )
191186 js .xeth = xeth .New (ethereum , f )
192187 js .wait = js .xeth .UpdateState ()
193188 js .client = client
194189 if clt , ok := js .client .(* comms.InProcClient ); ok {
195- if offeredApis , err := api .ParseApiString (shared .AllApis , codec .JSON , js .xeth , ethereum , docRoot ); err == nil {
190+ if offeredApis , err := api .ParseApiString (shared .AllApis , codec .JSON , js .xeth , ethereum ); err == nil {
196191 clt .Initialize (api .Merge (offeredApis ... ))
197192 }
198193 }
@@ -248,14 +243,14 @@ func (self *jsre) batch(statement string) {
248243// show summary of current geth instance
249244func (self * jsre ) welcome () {
250245 self .re .Run (`
251- (function () {
252- console.log('instance: ' + web3.version.client);
253- console.log(' datadir: ' + admin.datadir);
254- console.log("coinbase: " + eth.coinbase);
255- var ts = 1000 * eth.getBlock(eth.blockNumber).timestamp;
256- console.log("at block: " + eth.blockNumber + " (" + new Date(ts) + ")");
257- })();
258- ` )
246+ (function () {
247+ console.log('instance: ' + web3.version.client);
248+ console.log(' datadir: ' + admin.datadir);
249+ console.log("coinbase: " + eth.coinbase);
250+ var ts = 1000 * eth.getBlock(eth.blockNumber).timestamp;
251+ console.log("at block: " + eth.blockNumber + " (" + new Date(ts) + ")");
252+ })();
253+ ` )
259254 if modules , err := self .supportedApis (); err == nil {
260255 loadedModules := make ([]string , 0 )
261256 for api , version := range modules {
@@ -281,7 +276,7 @@ func (js *jsre) apiBindings(f xeth.Frontend) error {
281276 apiNames = append (apiNames , a )
282277 }
283278
284- apiImpl , err := api .ParseApiString (strings .Join (apiNames , "," ), codec .JSON , js .xeth , js .ethereum , js . docRoot )
279+ apiImpl , err := api .ParseApiString (strings .Join (apiNames , "," ), codec .JSON , js .xeth , js .ethereum )
285280 if err != nil {
286281 utils .Fatalf ("Unable to determine supported api's: %v" , err )
287282 }
@@ -334,7 +329,7 @@ func (js *jsre) apiBindings(f xeth.Frontend) error {
334329 utils .Fatalf ("Error setting namespaces: %v" , err )
335330 }
336331
337- js .re .Run (`var GlobalRegistrar = eth.contract(` + registrar .GlobalRegistrarAbi + `); registrar = GlobalRegistrar.at("` + registrar .GlobalRegistrarAddr + `");` )
332+ js .re .Run (`var GlobalRegistrar = eth.contract(` + registrar .GlobalRegistrarAbi + `); registrar = GlobalRegistrar.at("` + registrar .GlobalRegistrarAddr + `");` )
338333 return nil
339334}
340335
@@ -348,7 +343,7 @@ func (self *jsre) AskPassword() (string, bool) {
348343
349344func (self * jsre ) ConfirmTransaction (tx string ) bool {
350345 if self .ethereum .NatSpec {
351- notice := natspec .GetNotice (self .xeth , tx , self .ds )
346+ notice := natspec .GetNotice (self .xeth , tx , self .ethereum . HTTPClient () )
352347 fmt .Println (notice )
353348 answer , _ := self .Prompt ("Confirm Transaction [y/n]" )
354349 return strings .HasPrefix (strings .Trim (answer , " " ), "y" )
0 commit comments