From 22450c069b181e362710b71a763549cc6bc3e29b Mon Sep 17 00:00:00 2001 From: zelig Date: Tue, 21 Apr 2015 18:08:47 +0100 Subject: js console: add cors domain optional argument to startRpc --- cmd/geth/js_test.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'cmd/geth/js_test.go') diff --git a/cmd/geth/js_test.go b/cmd/geth/js_test.go index 521039121..662e195e5 100644 --- a/cmd/geth/js_test.go +++ b/cmd/geth/js_test.go @@ -3,16 +3,16 @@ package main import ( "fmt" "io/ioutil" - "path/filepath" "os" "path" + "path/filepath" "testing" "github.com/ethereum/go-ethereum/accounts" "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/eth" - "runtime" "regexp" + "runtime" "strconv" ) @@ -70,8 +70,8 @@ func TestAccounts(t *testing.T) { t.Errorf("address not hex: %q", addr) } - checkEvalJSON(t, repl, `eth.accounts`, `["` + addr + `"]`) - checkEvalJSON(t, repl, `eth.coinbase`, `"` + addr + `"`) + checkEvalJSON(t, repl, `eth.accounts`, `["`+addr+`"]`) + checkEvalJSON(t, repl, `eth.coinbase`, `"`+addr+`"`) } func TestBlockChain(t *testing.T) { @@ -97,13 +97,13 @@ func TestBlockChain(t *testing.T) { tmpfile := filepath.Join(tmp, "export.chain") tmpfileq := strconv.Quote(tmpfile) - checkEvalJSON(t, repl, `admin.export(` + tmpfileq + `)`, `true`) + checkEvalJSON(t, repl, `admin.export(`+tmpfileq+`)`, `true`) if _, err := os.Stat(tmpfile); err != nil { t.Fatal(err) } // check import, verify that dumpBlock gives the same result. - checkEvalJSON(t, repl, `admin.import(` + tmpfileq + `)`, `true`) + checkEvalJSON(t, repl, `admin.import(`+tmpfileq+`)`, `true`) checkEvalJSON(t, repl, `admin.debug.dumpBlock()`, beforeExport) } @@ -129,7 +129,7 @@ func TestRPC(t *testing.T) { } func checkEvalJSON(t *testing.T, re *jsre, expr, want string) error { - val, err := re.re.Run("JSON.stringify("+ expr + ")") + val, err := re.re.Run("JSON.stringify(" + expr + ")") if err == nil && val.String() != want { err = fmt.Errorf("Output mismatch for `%s`:\ngot: %s\nwant: %s", expr, val.String(), want) } -- cgit v1.2.3 From 6b1b5a4a2a8b315f4d0e7a08ab10563653711a92 Mon Sep 17 00:00:00 2001 From: zelig Date: Wed, 22 Apr 2015 14:55:01 +0100 Subject: cli/js console: if corsDomain is not given to startRpc, we fall back to value set on command line with `-corsDomain` --- cmd/geth/js_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cmd/geth/js_test.go') diff --git a/cmd/geth/js_test.go b/cmd/geth/js_test.go index 662e195e5..50528b80a 100644 --- a/cmd/geth/js_test.go +++ b/cmd/geth/js_test.go @@ -36,7 +36,7 @@ func testJEthRE(t *testing.T) (*jsre, *eth.Ethereum) { t.Fatal("%v", err) } assetPath := path.Join(os.Getenv("GOPATH"), "src", "github.com", "ethereum", "go-ethereum", "cmd", "mist", "assets", "ext") - repl := newJSRE(ethereum, assetPath, false) + repl := newJSRE(ethereum, assetPath, false, "") return repl, ethereum } -- cgit v1.2.3