updated BUGCMD.GO

This commit is contained in:
AnilChinchawale 2018-05-24 14:51:13 +05:30
parent 4a23b8c7ea
commit 821f8915a1
2 changed files with 27 additions and 27 deletions

View file

@ -142,14 +142,14 @@ Unlocking account f466859ead1932d743d622cb74fc058882e8648a | Attempt 1/3
!! Unsupported terminal, password will be echoed. !! Unsupported terminal, password will be echoed.
Passphrase: {{.InputLine "foobar"}} Passphrase: {{.InputLine "foobar"}}
`) `)
geth.ExpectExit() XDC.ExpectExit()
wantMessages := []string{ wantMessages := []string{
"Unlocked account", "Unlocked account",
"=0xf466859eAD1932D743d622CB74FC058882E8648A", "=0xf466859eAD1932D743d622CB74FC058882E8648A",
} }
for _, m := range wantMessages { for _, m := range wantMessages {
if !strings.Contains(geth.StderrText(), m) { if !strings.Contains(XDC.StderrText(), m) {
t.Errorf("stderr text does not contain %q", m) t.Errorf("stderr text does not contain %q", m)
} }
} }
@ -157,11 +157,11 @@ Passphrase: {{.InputLine "foobar"}}
func TestUnlockFlagWrongPassword(t *testing.T) { func TestUnlockFlagWrongPassword(t *testing.T) {
datadir := tmpDatadirWithKeystore(t) datadir := tmpDatadirWithKeystore(t)
geth := runGeth(t, XDC := runGeth(t,
"--datadir", datadir, "--nat", "none", "--nodiscover", "--maxpeers", "0", "--port", "0", "--datadir", datadir, "--nat", "none", "--nodiscover", "--maxpeers", "0", "--port", "0",
"--unlock", "f466859ead1932d743d622cb74fc058882e8648a") "--unlock", "f466859ead1932d743d622cb74fc058882e8648a")
defer geth.ExpectExit() defer XDC.ExpectExit()
geth.Expect(` XDC.Expect(`
Unlocking account f466859ead1932d743d622cb74fc058882e8648a | Attempt 1/3 Unlocking account f466859ead1932d743d622cb74fc058882e8648a | Attempt 1/3
!! Unsupported terminal, password will be echoed. !! Unsupported terminal, password will be echoed.
Passphrase: {{.InputLine "wrong1"}} Passphrase: {{.InputLine "wrong1"}}
@ -176,18 +176,18 @@ Fatal: Failed to unlock account f466859ead1932d743d622cb74fc058882e8648a (could
// https://github.com/ethereum/go-ethereum/issues/1785 // https://github.com/ethereum/go-ethereum/issues/1785
func TestUnlockFlagMultiIndex(t *testing.T) { func TestUnlockFlagMultiIndex(t *testing.T) {
datadir := tmpDatadirWithKeystore(t) datadir := tmpDatadirWithKeystore(t)
geth := runGeth(t, XDC := runGeth(t,
"--datadir", datadir, "--nat", "none", "--nodiscover", "--maxpeers", "0", "--port", "0", "--datadir", datadir, "--nat", "none", "--nodiscover", "--maxpeers", "0", "--port", "0",
"--unlock", "0,2", "--unlock", "0,2",
"js", "testdata/empty.js") "js", "testdata/empty.js")
geth.Expect(` XDC.Expect(`
Unlocking account 0 | Attempt 1/3 Unlocking account 0 | Attempt 1/3
!! Unsupported terminal, password will be echoed. !! Unsupported terminal, password will be echoed.
Passphrase: {{.InputLine "foobar"}} Passphrase: {{.InputLine "foobar"}}
Unlocking account 2 | Attempt 1/3 Unlocking account 2 | Attempt 1/3
Passphrase: {{.InputLine "foobar"}} Passphrase: {{.InputLine "foobar"}}
`) `)
geth.ExpectExit() XDC.ExpectExit()
wantMessages := []string{ wantMessages := []string{
"Unlocked account", "Unlocked account",
@ -195,7 +195,7 @@ Passphrase: {{.InputLine "foobar"}}
"=0x289d485D9771714CCe91D3393D764E1311907ACc", "=0x289d485D9771714CCe91D3393D764E1311907ACc",
} }
for _, m := range wantMessages { for _, m := range wantMessages {
if !strings.Contains(geth.StderrText(), m) { if !strings.Contains(XDC.StderrText(), m) {
t.Errorf("stderr text does not contain %q", m) t.Errorf("stderr text does not contain %q", m)
} }
} }
@ -203,11 +203,11 @@ Passphrase: {{.InputLine "foobar"}}
func TestUnlockFlagPasswordFile(t *testing.T) { func TestUnlockFlagPasswordFile(t *testing.T) {
datadir := tmpDatadirWithKeystore(t) datadir := tmpDatadirWithKeystore(t)
geth := runGeth(t, XDC := runGeth(t,
"--datadir", datadir, "--nat", "none", "--nodiscover", "--maxpeers", "0", "--port", "0", "--datadir", datadir, "--nat", "none", "--nodiscover", "--maxpeers", "0", "--port", "0",
"--password", "testdata/passwords.txt", "--unlock", "0,2", "--password", "testdata/passwords.txt", "--unlock", "0,2",
"js", "testdata/empty.js") "js", "testdata/empty.js")
geth.ExpectExit() XDC.ExpectExit()
wantMessages := []string{ wantMessages := []string{
"Unlocked account", "Unlocked account",
@ -215,7 +215,7 @@ func TestUnlockFlagPasswordFile(t *testing.T) {
"=0x289d485D9771714CCe91D3393D764E1311907ACc", "=0x289d485D9771714CCe91D3393D764E1311907ACc",
} }
for _, m := range wantMessages { for _, m := range wantMessages {
if !strings.Contains(geth.StderrText(), m) { if !strings.Contains(XDC.StderrText(), m) {
t.Errorf("stderr text does not contain %q", m) t.Errorf("stderr text does not contain %q", m)
} }
} }
@ -223,29 +223,29 @@ func TestUnlockFlagPasswordFile(t *testing.T) {
func TestUnlockFlagPasswordFileWrongPassword(t *testing.T) { func TestUnlockFlagPasswordFileWrongPassword(t *testing.T) {
datadir := tmpDatadirWithKeystore(t) datadir := tmpDatadirWithKeystore(t)
geth := runGeth(t, XDC := runGeth(t,
"--datadir", datadir, "--nat", "none", "--nodiscover", "--maxpeers", "0", "--port", "0", "--datadir", datadir, "--nat", "none", "--nodiscover", "--maxpeers", "0", "--port", "0",
"--password", "testdata/wrong-passwords.txt", "--unlock", "0,2") "--password", "testdata/wrong-passwords.txt", "--unlock", "0,2")
defer geth.ExpectExit() defer XDC.ExpectExit()
geth.Expect(` XDC.Expect(`
Fatal: Failed to unlock account 0 (could not decrypt key with given passphrase) Fatal: Failed to unlock account 0 (could not decrypt key with given passphrase)
`) `)
} }
func TestUnlockFlagAmbiguous(t *testing.T) { func TestUnlockFlagAmbiguous(t *testing.T) {
store := filepath.Join("..", "..", "accounts", "keystore", "testdata", "dupes") store := filepath.Join("..", "..", "accounts", "keystore", "testdata", "dupes")
geth := runGeth(t, XDC := runGeth(t,
"--keystore", store, "--nat", "none", "--nodiscover", "--maxpeers", "0", "--port", "0", "--keystore", store, "--nat", "none", "--nodiscover", "--maxpeers", "0", "--port", "0",
"--unlock", "f466859ead1932d743d622cb74fc058882e8648a", "--unlock", "f466859ead1932d743d622cb74fc058882e8648a",
"js", "testdata/empty.js") "js", "testdata/empty.js")
defer geth.ExpectExit() defer XDC.ExpectExit()
// Helper for the expect template, returns absolute keystore path. // Helper for the expect template, returns absolute keystore path.
geth.SetTemplateFunc("keypath", func(file string) string { XDC.SetTemplateFunc("keypath", func(file string) string {
abs, _ := filepath.Abs(filepath.Join(store, file)) abs, _ := filepath.Abs(filepath.Join(store, file))
return abs return abs
}) })
geth.Expect(` XDC.Expect(`
Unlocking account f466859ead1932d743d622cb74fc058882e8648a | Attempt 1/3 Unlocking account f466859ead1932d743d622cb74fc058882e8648a | Attempt 1/3
!! Unsupported terminal, password will be echoed. !! Unsupported terminal, password will be echoed.
Passphrase: {{.InputLine "foobar"}} Passphrase: {{.InputLine "foobar"}}
@ -257,14 +257,14 @@ Your passphrase unlocked keystore://{{keypath "1"}}
In order to avoid this warning, you need to remove the following duplicate key files: In order to avoid this warning, you need to remove the following duplicate key files:
keystore://{{keypath "2"}} keystore://{{keypath "2"}}
`) `)
geth.ExpectExit() XDC.ExpectExit()
wantMessages := []string{ wantMessages := []string{
"Unlocked account", "Unlocked account",
"=0xf466859eAD1932D743d622CB74FC058882E8648A", "=0xf466859eAD1932D743d622CB74FC058882E8648A",
} }
for _, m := range wantMessages { for _, m := range wantMessages {
if !strings.Contains(geth.StderrText(), m) { if !strings.Contains(XDC.StderrText(), m) {
t.Errorf("stderr text does not contain %q", m) t.Errorf("stderr text does not contain %q", m)
} }
} }
@ -272,17 +272,17 @@ In order to avoid this warning, you need to remove the following duplicate key f
func TestUnlockFlagAmbiguousWrongPassword(t *testing.T) { func TestUnlockFlagAmbiguousWrongPassword(t *testing.T) {
store := filepath.Join("..", "..", "accounts", "keystore", "testdata", "dupes") store := filepath.Join("..", "..", "accounts", "keystore", "testdata", "dupes")
geth := runGeth(t, XDC := runGeth(t,
"--keystore", store, "--nat", "none", "--nodiscover", "--maxpeers", "0", "--port", "0", "--keystore", store, "--nat", "none", "--nodiscover", "--maxpeers", "0", "--port", "0",
"--unlock", "f466859ead1932d743d622cb74fc058882e8648a") "--unlock", "f466859ead1932d743d622cb74fc058882e8648a")
defer geth.ExpectExit() defer XDC.ExpectExit()
// Helper for the expect template, returns absolute keystore path. // Helper for the expect template, returns absolute keystore path.
geth.SetTemplateFunc("keypath", func(file string) string { XDC.SetTemplateFunc("keypath", func(file string) string {
abs, _ := filepath.Abs(filepath.Join(store, file)) abs, _ := filepath.Abs(filepath.Join(store, file))
return abs return abs
}) })
geth.Expect(` XDC.Expect(`
Unlocking account f466859ead1932d743d622cb74fc058882e8648a | Attempt 1/3 Unlocking account f466859ead1932d743d622cb74fc058882e8648a | Attempt 1/3
!! Unsupported terminal, password will be echoed. !! Unsupported terminal, password will be echoed.
Passphrase: {{.InputLine "wrong"}} Passphrase: {{.InputLine "wrong"}}
@ -292,5 +292,5 @@ Multiple key files exist for address f466859ead1932d743d622cb74fc058882e8648a:
Testing your passphrase against all of them... Testing your passphrase against all of them...
Fatal: None of the listed files could be unlocked. Fatal: None of the listed files could be unlocked.
`) `)
geth.ExpectExit() XDC.ExpectExit()
} }

View file

@ -36,7 +36,7 @@ import (
var bugCommand = cli.Command{ var bugCommand = cli.Command{
Action: utils.MigrateFlags(reportBug), Action: utils.MigrateFlags(reportBug),
Name: "bug", Name: "bug",
Usage: "opens a window to report a bug on the geth repo", Usage: "opens a window to report a bug on the XDC repo",
ArgsUsage: " ", ArgsUsage: " ",
Category: "MISCELLANEOUS COMMANDS", Category: "MISCELLANEOUS COMMANDS",
} }