diff --git a/cmd/tomo/accountcmd_test.go b/cmd/tomo/accountcmd_test.go index 4820227a58..2c67c59e10 100644 --- a/cmd/tomo/accountcmd_test.go +++ b/cmd/tomo/accountcmd_test.go @@ -43,13 +43,13 @@ func tmpDatadirWithKeystore(t *testing.T) string { } func TestAccountListEmpty(t *testing.T) { - tomo := runGeth(t, "account", "list") + tomo := runTomo(t, "account", "list") tomo.ExpectExit() } func TestAccountList(t *testing.T) { datadir := tmpDatadirWithKeystore(t) - tomo := runGeth(t, "account", "list", "--datadir", datadir) + tomo := runTomo(t, "account", "list", "--datadir", datadir) defer tomo.ExpectExit() if runtime.GOOS == "windows" { tomo.Expect(` @@ -67,7 +67,7 @@ Account #2: {289d485d9771714cce91d3393d764e1311907acc} keystore://{{.Datadir}}/k } func TestAccountNew(t *testing.T) { - tomo := runGeth(t, "account", "new", "--lightkdf") + tomo := runTomo(t, "account", "new", "--lightkdf") defer tomo.ExpectExit() tomo.Expect(` Your new account is locked with a password. Please give a password. Do not forget this password. @@ -79,7 +79,7 @@ Repeat passphrase: {{.InputLine "foobar"}} } func TestAccountNewBadRepeat(t *testing.T) { - tomo := runGeth(t, "account", "new", "--lightkdf") + tomo := runTomo(t, "account", "new", "--lightkdf") defer tomo.ExpectExit() tomo.Expect(` Your new account is locked with a password. Please give a password. Do not forget this password. @@ -92,7 +92,7 @@ Fatal: Passphrases do not match func TestAccountUpdate(t *testing.T) { datadir := tmpDatadirWithKeystore(t) - tomo := runGeth(t, "account", "update", + tomo := runTomo(t, "account", "update", "--datadir", datadir, "--lightkdf", "f466859ead1932d743d622cb74fc058882e8648a") defer tomo.ExpectExit() @@ -107,7 +107,7 @@ Repeat passphrase: {{.InputLine "foobar2"}} } func TestWalletImport(t *testing.T) { - tomo := runGeth(t, "wallet", "import", "--lightkdf", "testdata/guswallet.json") + tomo := runTomo(t, "wallet", "import", "--lightkdf", "testdata/guswallet.json") defer tomo.ExpectExit() tomo.Expect(` !! Unsupported terminal, password will be echoed. @@ -122,7 +122,7 @@ Address: {d4584b5f6229b7be90727b0fc8c6b91bb427821f} } func TestWalletImportBadPassword(t *testing.T) { - tomo := runGeth(t, "wallet", "import", "--lightkdf", "testdata/guswallet.json") + tomo := runTomo(t, "wallet", "import", "--lightkdf", "testdata/guswallet.json") defer tomo.ExpectExit() tomo.Expect(` !! Unsupported terminal, password will be echoed. @@ -133,7 +133,7 @@ Fatal: could not decrypt key with given passphrase func TestUnlockFlag(t *testing.T) { datadir := tmpDatadirWithKeystore(t) - tomo := runGeth(t, + tomo := runTomo(t, "--datadir", datadir, "--nat", "none", "--nodiscover", "--maxpeers", "0", "--port", "0", "--unlock", "f466859ead1932d743d622cb74fc058882e8648a", "js", "testdata/empty.js") @@ -157,7 +157,7 @@ Passphrase: {{.InputLine "foobar"}} func TestUnlockFlagWrongPassword(t *testing.T) { datadir := tmpDatadirWithKeystore(t) - tomo := runGeth(t, + tomo := runTomo(t, "--datadir", datadir, "--nat", "none", "--nodiscover", "--maxpeers", "0", "--port", "0", "--unlock", "f466859ead1932d743d622cb74fc058882e8648a") defer tomo.ExpectExit() @@ -176,7 +176,7 @@ Fatal: Failed to unlock account f466859ead1932d743d622cb74fc058882e8648a (could // https://github.com/ethereum/go-ethereum/issues/1785 func TestUnlockFlagMultiIndex(t *testing.T) { datadir := tmpDatadirWithKeystore(t) - tomo := runGeth(t, + tomo := runTomo(t, "--datadir", datadir, "--nat", "none", "--nodiscover", "--maxpeers", "0", "--port", "0", "--unlock", "0,2", "js", "testdata/empty.js") @@ -203,7 +203,7 @@ Passphrase: {{.InputLine "foobar"}} func TestUnlockFlagPasswordFile(t *testing.T) { datadir := tmpDatadirWithKeystore(t) - tomo := runGeth(t, + tomo := runTomo(t, "--datadir", datadir, "--nat", "none", "--nodiscover", "--maxpeers", "0", "--port", "0", "--password", "testdata/passwords.txt", "--unlock", "0,2", "js", "testdata/empty.js") @@ -223,7 +223,7 @@ func TestUnlockFlagPasswordFile(t *testing.T) { func TestUnlockFlagPasswordFileWrongPassword(t *testing.T) { datadir := tmpDatadirWithKeystore(t) - tomo := runGeth(t, + tomo := runTomo(t, "--datadir", datadir, "--nat", "none", "--nodiscover", "--maxpeers", "0", "--port", "0", "--password", "testdata/wrong-passwords.txt", "--unlock", "0,2") defer tomo.ExpectExit() @@ -234,7 +234,7 @@ Fatal: Failed to unlock account 0 (could not decrypt key with given passphrase) func TestUnlockFlagAmbiguous(t *testing.T) { store := filepath.Join("..", "..", "accounts", "keystore", "testdata", "dupes") - tomo := runGeth(t, + tomo := runTomo(t, "--keystore", store, "--nat", "none", "--nodiscover", "--maxpeers", "0", "--port", "0", "--unlock", "f466859ead1932d743d622cb74fc058882e8648a", "js", "testdata/empty.js") @@ -272,7 +272,7 @@ In order to avoid this warning, you need to remove the following duplicate key f func TestUnlockFlagAmbiguousWrongPassword(t *testing.T) { store := filepath.Join("..", "..", "accounts", "keystore", "testdata", "dupes") - tomo := runGeth(t, + tomo := runTomo(t, "--keystore", store, "--nat", "none", "--nodiscover", "--maxpeers", "0", "--port", "0", "--unlock", "f466859ead1932d743d622cb74fc058882e8648a") defer tomo.ExpectExit() diff --git a/cmd/tomo/consolecmd_test.go b/cmd/tomo/consolecmd_test.go index 9e6db7ebfe..a1e46a736d 100644 --- a/cmd/tomo/consolecmd_test.go +++ b/cmd/tomo/consolecmd_test.go @@ -41,7 +41,7 @@ func TestConsoleWelcome(t *testing.T) { coinbase := "0x8605cdbbdb6d264aa742e77020dcbc58fcdce182" // Start a tomo console, make sure it's cleaned up and terminate the console - tomo := runGeth(t, + tomo := runTomo(t, "--port", "0", "--maxpeers", "0", "--nodiscover", "--nat", "none", "--etherbase", coinbase, "--shh", "console") @@ -58,7 +58,7 @@ func TestConsoleWelcome(t *testing.T) { tomo.Expect(` Welcome to the Tomo JavaScript console! -instance: Tomo/v{{tomover}}/{{goos}}-{{goarch}}/{{gover}} +instance: tomo/v{{tomover}}/{{goos}}-{{goarch}}/{{gover}} coinbase: {{.Etherbase}} at block: 0 ({{niltime}}) datadir: {{.Datadir}} @@ -83,7 +83,7 @@ func TestIPCAttachWelcome(t *testing.T) { } // Note: we need --shh because testAttachWelcome checks for default // list of ipc modules and shh is included there. - tomo := runGeth(t, + tomo := runTomo(t, "--port", "0", "--maxpeers", "0", "--nodiscover", "--nat", "none", "--etherbase", coinbase, "--shh", "--ipcpath", ipc) @@ -97,7 +97,7 @@ func TestIPCAttachWelcome(t *testing.T) { func TestHTTPAttachWelcome(t *testing.T) { coinbase := "0x8605cdbbdb6d264aa742e77020dcbc58fcdce182" port := strconv.Itoa(trulyRandInt(1024, 65536)) // Yeah, sometimes this will fail, sorry :P - tomo := runGeth(t, + tomo := runTomo(t, "--port", "0", "--maxpeers", "0", "--nodiscover", "--nat", "none", "--etherbase", coinbase, "--rpc", "--rpcport", port) @@ -112,7 +112,7 @@ func TestWSAttachWelcome(t *testing.T) { coinbase := "0x8605cdbbdb6d264aa742e77020dcbc58fcdce182" port := strconv.Itoa(trulyRandInt(1024, 65536)) // Yeah, sometimes this will fail, sorry :P - tomo := runGeth(t, + tomo := runTomo(t, "--port", "0", "--maxpeers", "0", "--nodiscover", "--nat", "none", "--etherbase", coinbase, "--ws", "--wsport", port) @@ -125,7 +125,7 @@ func TestWSAttachWelcome(t *testing.T) { func testAttachWelcome(t *testing.T, tomo *testtomo, endpoint, apis string) { // Attach to a running tomo note and terminate immediately - attach := runGeth(t, "attach", endpoint) + attach := runTomo(t, "attach", endpoint) defer attach.ExpectExit() attach.CloseStdin() @@ -144,7 +144,7 @@ func testAttachWelcome(t *testing.T, tomo *testtomo, endpoint, apis string) { attach.Expect(` Welcome to the Tomo JavaScript console! -instance: Tomo/v{{tomover}}/{{goos}}-{{goarch}}/{{gover}} +instance: tomo/v{{tomover}}/{{goos}}-{{goarch}}/{{gover}} coinbase: {{etherbase}} at block: 0 ({{niltime}}){{if ipc}} datadir: {{datadir}}{{end}} diff --git a/cmd/tomo/dao_test.go b/cmd/tomo/dao_test.go index 9bcd49e1e5..57ad762d11 100644 --- a/cmd/tomo/dao_test.go +++ b/cmd/tomo/dao_test.go @@ -112,11 +112,11 @@ func testDAOForkBlockNewChain(t *testing.T, test int, genesis string, expectBloc if err := ioutil.WriteFile(json, []byte(genesis), 0600); err != nil { t.Fatalf("test %d: failed to write genesis file: %v", test, err) } - runGeth(t, "--datadir", datadir, "init", json).WaitExit() + runTomo(t, "--datadir", datadir, "init", json).WaitExit() } else { // Force chain initialization args := []string{"--port", "0", "--maxpeers", "0", "--nodiscover", "--nat", "none", "--ipcdisable", "--datadir", datadir} - tomo := runGeth(t, append(args, []string{"--exec", "2+2", "console"}...)...) + tomo := runTomo(t, append(args, []string{"--exec", "2+2", "console"}...)...) tomo.WaitExit() } // Retrieve the DAO config flag from the database diff --git a/cmd/tomo/genesis_test.go b/cmd/tomo/genesis_test.go index 79c055d36d..b2fe8ea306 100644 --- a/cmd/tomo/genesis_test.go +++ b/cmd/tomo/genesis_test.go @@ -97,10 +97,10 @@ func TestCustomGenesis(t *testing.T) { if err := ioutil.WriteFile(json, []byte(tt.genesis), 0600); err != nil { t.Fatalf("test %d: failed to write genesis file: %v", i, err) } - runGeth(t, "--datadir", datadir, "init", json).WaitExit() + runTomo(t, "--datadir", datadir, "init", json).WaitExit() // Query the custom genesis block - tomo := runGeth(t, + tomo := runTomo(t, "--datadir", datadir, "--maxpeers", "0", "--port", "0", "--nodiscover", "--nat", "none", "--ipcdisable", "--exec", tt.query, "console") diff --git a/cmd/tomo/run_test.go b/cmd/tomo/run_test.go index 92abecb19d..ba065a6aed 100644 --- a/cmd/tomo/run_test.go +++ b/cmd/tomo/run_test.go @@ -63,7 +63,7 @@ func TestMain(m *testing.M) { // spawns tomo with the given command line args. If the args don't set --datadir, the // child g gets a temporary data directory. -func runtomo(t *testing.T, args ...string) *testtomo { +func runTomo(t *testing.T, args ...string) *testtomo { tt := &testtomo{} tt.TestCmd = cmdtest.NewTestCmd(t, tt) for i, arg := range args { diff --git a/console/console.go b/console/console.go index b280d4e65d..5019ea180e 100644 --- a/console/console.go +++ b/console/console.go @@ -272,8 +272,8 @@ func (c *Console) AutoCompleteInput(line string, pos int) (string, []string, str // Welcome show summary of current Geth instance and some metadata about the // console's available modules. func (c *Console) Welcome() { - // Print some generic Geth metadata - fmt.Fprintf(c.printer, "Welcome to the Geth JavaScript console!\n\n") + // Print some generic Tomo metadata + fmt.Fprintf(c.printer, "Welcome to the Tomo JavaScript console!\n\n") c.jsre.Run(` console.log("instance: " + web3.version.node); console.log("coinbase: " + eth.coinbase); diff --git a/internal/cmdtest/test_cmd.go b/internal/cmdtest/test_cmd.go index 20e82ec2a9..c2969f8dd1 100644 --- a/internal/cmdtest/test_cmd.go +++ b/internal/cmdtest/test_cmd.go @@ -124,7 +124,7 @@ func (tt *TestCmd) matchExactOutput(want []byte) error { // Find the mismatch position. for i := 0; i < n; i++ { if want[i] != buf[i] { - return fmt.Errorf("Output mismatch at ā—Š:\n---------------- (stdout text)\n%sā—Š%s\n---------------- (expected text)\n%s", + return fmt.Errorf("Output mismatch at ā—Š:\n---------------- (stdout text)\n%s%s\n---------------- (expected text)\n%s", buf[:i], buf[i:n], want) } }