Skip to content

Commit 916d155

Browse files
committed
Merge pull request #1429 from obscuren/rebase-registrar
Rebase registrar
2 parents d764bd0 + c5cb6e8 commit 916d155

32 files changed

+1944
-679
lines changed

cmd/geth/blocktestcmd.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,6 @@ func runBlockTest(ctx *cli.Context) {
8686
}
8787

8888
func runOneBlockTest(ctx *cli.Context, test *tests.BlockTest) (*eth.Ethereum, error) {
89-
// TODO remove in favor of logic contained in tests package
9089
cfg := utils.MakeEthConfig(ClientIdentifier, Version, ctx)
9190
cfg.NewDB = func(path string) (common.Database, error) { return ethdb.NewMemDatabase() }
9291
cfg.MaxPeers = 0 // disable network

cmd/geth/contracts.go

Lines changed: 0 additions & 6 deletions
This file was deleted.

cmd/geth/js.go

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,16 +32,17 @@ import (
3232
"github.com/ethereum/go-ethereum/common"
3333
"github.com/ethereum/go-ethereum/common/docserver"
3434
"github.com/ethereum/go-ethereum/common/natspec"
35+
"github.com/ethereum/go-ethereum/common/registrar"
3536
"github.com/ethereum/go-ethereum/eth"
3637
re "github.com/ethereum/go-ethereum/jsre"
3738
"github.com/ethereum/go-ethereum/rpc"
3839
"github.com/ethereum/go-ethereum/rpc/api"
3940
"github.com/ethereum/go-ethereum/rpc/codec"
4041
"github.com/ethereum/go-ethereum/rpc/comms"
42+
"github.com/ethereum/go-ethereum/rpc/shared"
4143
"github.com/ethereum/go-ethereum/xeth"
4244
"github.com/peterh/liner"
4345
"github.com/robertkrimen/otto"
44-
"github.com/ethereum/go-ethereum/rpc/shared"
4546
)
4647

4748
type prompter interface {
@@ -69,6 +70,7 @@ func (r dumbterm) PasswordPrompt(p string) (string, error) {
6970
func (r dumbterm) AppendHistory(string) {}
7071

7172
type jsre struct {
73+
ds *docserver.DocServer
7274
re *re.JSRE
7375
ethereum *eth.Ethereum
7476
xeth *xeth.XEth
@@ -143,6 +145,7 @@ func newLightweightJSRE(libPath string, client comms.EthereumClient, interactive
143145
js := &jsre{ps1: "> "}
144146
js.wait = make(chan *big.Int)
145147
js.client = client
148+
js.ds = docserver.New("/")
146149

147150
if f == nil {
148151
f = js
@@ -180,6 +183,7 @@ func newJSRE(ethereum *eth.Ethereum, libPath, corsDomain string, client comms.Et
180183
if f == nil {
181184
f = js
182185
}
186+
js.ds = docserver.New("/")
183187
js.xeth = xeth.New(ethereum, f)
184188
js.wait = js.xeth.UpdateState()
185189
js.client = client
@@ -331,15 +335,13 @@ func (js *jsre) apiBindings(f xeth.Frontend) error {
331335
utils.Fatalf("Error setting namespaces: %v", err)
332336
}
333337

334-
js.re.Eval(globalRegistrar + "registrar = GlobalRegistrar.at(\"" + globalRegistrarAddr + "\");")
338+
js.re.Eval(`var GlobalRegistrar = eth.contract(` + registrar.GlobalRegistrarAbi + `); registrar = GlobalRegistrar.at("` + registrar.GlobalRegistrarAddr + `");`)
335339
return nil
336340
}
337341

338-
var ds, _ = docserver.New("/")
339-
340342
func (self *jsre) ConfirmTransaction(tx string) bool {
341343
if self.ethereum.NatSpec {
342-
notice := natspec.GetNotice(self.xeth, tx, ds)
344+
notice := natspec.GetNotice(self.xeth, tx, self.ds)
343345
fmt.Println(notice)
344346
answer, _ := self.Prompt("Confirm Transaction [y/n]")
345347
return strings.HasPrefix(strings.Trim(answer, " "), "y")

0 commit comments

Comments
 (0)