From c095cc3e6f5bf1cc4d0fe1c2a27d12483a2e25ee Mon Sep 17 00:00:00 2001 From: AnilChinchawale Date: Mon, 28 May 2018 16:17:11 +0530 Subject: [PATCH] FIX TYPO --- cmd/XDC/accountcmd_test.go | 26 +++++++++++++------------- cmd/XDC/consolecmd_test.go | 10 +++++----- cmd/XDC/dao_test.go | 4 ++-- cmd/XDC/genesis_test.go | 4 ++-- console/console.go | 4 ++-- internal/cmdtest/test_cmd.go | 2 +- 6 files changed, 25 insertions(+), 25 deletions(-) diff --git a/cmd/XDC/accountcmd_test.go b/cmd/XDC/accountcmd_test.go index 1cf9fc0e2d..3f435454fe 100644 --- a/cmd/XDC/accountcmd_test.go +++ b/cmd/XDC/accountcmd_test.go @@ -43,13 +43,13 @@ func tmpDatadirWithKeystore(t *testing.T) string { } func TestAccountListEmpty(t *testing.T) { - XDC := runGeth(t, "account", "list") + XDC := runXDC(t, "account", "list") XDC.ExpectExit() } func TestAccountList(t *testing.T) { datadir := tmpDatadirWithKeystore(t) - XDC := runGeth(t, "account", "list", "--datadir", datadir) + XDC := runXDC(t, "account", "list", "--datadir", datadir) defer XDC.ExpectExit() if runtime.GOOS == "windows" { XDC.Expect(` @@ -67,7 +67,7 @@ Account #2: {289d485d9771714cce91d3393d764e1311907acc} keystore://{{.Datadir}}/k } func TestAccountNew(t *testing.T) { - XDC := runGeth(t, "account", "new", "--lightkdf") + XDC := runXDC(t, "account", "new", "--lightkdf") defer XDC.ExpectExit() XDC.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) { - XDC := runGeth(t, "account", "new", "--lightkdf") + XDC := runXDC(t, "account", "new", "--lightkdf") defer XDC.ExpectExit() XDC.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) - XDC := runGeth(t, "account", "update", + XDC := runXDC(t, "account", "update", "--datadir", datadir, "--lightkdf", "f466859ead1932d743d622cb74fc058882e8648a") defer XDC.ExpectExit() @@ -107,7 +107,7 @@ Repeat passphrase: {{.InputLine "foobar2"}} } func TestWalletImport(t *testing.T) { - XDC := runGeth(t, "wallet", "import", "--lightkdf", "testdata/guswallet.json") + XDC := runXDC(t, "wallet", "import", "--lightkdf", "testdata/guswallet.json") defer XDC.ExpectExit() XDC.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) - XDC := runGeth(t, + XDC := runXDC(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) - XDC := runGeth(t, + XDC := runXDC(t, "--datadir", datadir, "--nat", "none", "--nodiscover", "--maxpeers", "0", "--port", "0", "--unlock", "f466859ead1932d743d622cb74fc058882e8648a") defer XDC.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) - XDC := runGeth(t, + XDC := runXDC(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) - XDC := runGeth(t, + XDC := runXDC(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) - XDC := runGeth(t, + XDC := runXDC(t, "--datadir", datadir, "--nat", "none", "--nodiscover", "--maxpeers", "0", "--port", "0", "--password", "testdata/wrong-passwords.txt", "--unlock", "0,2") defer XDC.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") - XDC := runGeth(t, + XDC := runXDC(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") - XDC := runGeth(t, + XDC := runXDC(t, "--keystore", store, "--nat", "none", "--nodiscover", "--maxpeers", "0", "--port", "0", "--unlock", "f466859ead1932d743d622cb74fc058882e8648a") defer XDC.ExpectExit() diff --git a/cmd/XDC/consolecmd_test.go b/cmd/XDC/consolecmd_test.go index fc48d696c5..cfe97243b2 100644 --- a/cmd/XDC/consolecmd_test.go +++ b/cmd/XDC/consolecmd_test.go @@ -41,7 +41,7 @@ func TestConsoleWelcome(t *testing.T) { coinbase := "0x8605cdbbdb6d264aa742e77020dcbc58fcdce182" // Start a XDC console, make sure it's cleaned up and terminate the console - XDC := runGeth(t, + XDC := runXDC(t, "--port", "0", "--maxpeers", "0", "--nodiscover", "--nat", "none", "--etherbase", coinbase, "--shh", "console") @@ -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. - XDC := runGeth(t, + XDC := runXDC(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 - XDC := runGeth(t, + XDC := runXDC(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 - XDC := runGeth(t, + XDC := runXDC(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, XDC *testXDC, endpoint, apis string) { // Attach to a running XDC note and terminate 1immediately - attach := runGeth(t, "attach", endpoint) + attach := runXDC(t, "attach", endpoint) defer attach.ExpectExit() attach.CloseStdin() diff --git a/cmd/XDC/dao_test.go b/cmd/XDC/dao_test.go index 3f058dab22..b22746262c 100644 --- a/cmd/XDC/dao_test.go +++ b/cmd/XDC/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() + runXDC(t, "--datadir", datadir, "init", json).WaitExit() } else { // Force chain initialization args := []string{"--port", "0", "--maxpeers", "0", "--nodiscover", "--nat", "none", "--ipcdisable", "--datadir", datadir} - XDC := runGeth(t, append(args, []string{"--exec", "2+2", "console"}...)...) + XDC := runXDC(t, append(args, []string{"--exec", "2+2", "console"}...)...) XDC.WaitExit() } // Retrieve the DAO config flag from the database diff --git a/cmd/XDC/genesis_test.go b/cmd/XDC/genesis_test.go index e14f342087..9044e6e8ef 100644 --- a/cmd/XDC/genesis_test.go +++ b/cmd/XDC/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() + runXDC(t, "--datadir", datadir, "init", json).WaitExit() // Query the custom genesis block - XDC := runGeth(t, + XDC := runXDC(t, "--datadir", datadir, "--maxpeers", "0", "--port", "0", "--nodiscover", "--nat", "none", "--ipcdisable", "--exec", tt.query, "console") diff --git a/console/console.go b/console/console.go index b280d4e65d..e17614bcb0 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 XDC metadata + fmt.Fprintf(c.printer, "Welcome to the XinFin 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) } }