Skip to content

Commit

Permalink
fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
ngtuna committed Apr 10, 2018
1 parent a9b8b7a commit a29caba
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 29 deletions.
28 changes: 14 additions & 14 deletions cmd/tomo/accountcmd_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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(`
Expand All @@ -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.
Expand All @@ -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.
Expand All @@ -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()
Expand All @@ -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.
Expand All @@ -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.
Expand All @@ -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")
Expand All @@ -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()
Expand All @@ -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")
Expand All @@ -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")
Expand All @@ -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()
Expand All @@ -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")
Expand Down Expand Up @@ -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()
Expand Down
14 changes: 7 additions & 7 deletions cmd/tomo/consolecmd_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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}}
Expand All @@ -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)

Expand All @@ -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)

Expand All @@ -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)

Expand All @@ -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()

Expand All @@ -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}}
Expand Down
4 changes: 2 additions & 2 deletions cmd/tomo/dao_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions cmd/tomo/genesis_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
2 changes: 1 addition & 1 deletion cmd/tomo/run_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions console/console.go
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion internal/cmdtest/test_cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
Expand Down

0 comments on commit a29caba

Please sign in to comment.