mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-18 02:40:45 +00:00
FIX TYPO
This commit is contained in:
parent
dd02e14d42
commit
c095cc3e6f
6 changed files with 25 additions and 25 deletions
|
|
@ -43,13 +43,13 @@ func tmpDatadirWithKeystore(t *testing.T) string {
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestAccountListEmpty(t *testing.T) {
|
func TestAccountListEmpty(t *testing.T) {
|
||||||
XDC := runGeth(t, "account", "list")
|
XDC := runXDC(t, "account", "list")
|
||||||
XDC.ExpectExit()
|
XDC.ExpectExit()
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestAccountList(t *testing.T) {
|
func TestAccountList(t *testing.T) {
|
||||||
datadir := tmpDatadirWithKeystore(t)
|
datadir := tmpDatadirWithKeystore(t)
|
||||||
XDC := runGeth(t, "account", "list", "--datadir", datadir)
|
XDC := runXDC(t, "account", "list", "--datadir", datadir)
|
||||||
defer XDC.ExpectExit()
|
defer XDC.ExpectExit()
|
||||||
if runtime.GOOS == "windows" {
|
if runtime.GOOS == "windows" {
|
||||||
XDC.Expect(`
|
XDC.Expect(`
|
||||||
|
|
@ -67,7 +67,7 @@ Account #2: {289d485d9771714cce91d3393d764e1311907acc} keystore://{{.Datadir}}/k
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestAccountNew(t *testing.T) {
|
func TestAccountNew(t *testing.T) {
|
||||||
XDC := runGeth(t, "account", "new", "--lightkdf")
|
XDC := runXDC(t, "account", "new", "--lightkdf")
|
||||||
defer XDC.ExpectExit()
|
defer XDC.ExpectExit()
|
||||||
XDC.Expect(`
|
XDC.Expect(`
|
||||||
Your new account is locked with a password. Please give a password. Do not forget this password.
|
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) {
|
func TestAccountNewBadRepeat(t *testing.T) {
|
||||||
XDC := runGeth(t, "account", "new", "--lightkdf")
|
XDC := runXDC(t, "account", "new", "--lightkdf")
|
||||||
defer XDC.ExpectExit()
|
defer XDC.ExpectExit()
|
||||||
XDC.Expect(`
|
XDC.Expect(`
|
||||||
Your new account is locked with a password. Please give a password. Do not forget this password.
|
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) {
|
func TestAccountUpdate(t *testing.T) {
|
||||||
datadir := tmpDatadirWithKeystore(t)
|
datadir := tmpDatadirWithKeystore(t)
|
||||||
XDC := runGeth(t, "account", "update",
|
XDC := runXDC(t, "account", "update",
|
||||||
"--datadir", datadir, "--lightkdf",
|
"--datadir", datadir, "--lightkdf",
|
||||||
"f466859ead1932d743d622cb74fc058882e8648a")
|
"f466859ead1932d743d622cb74fc058882e8648a")
|
||||||
defer XDC.ExpectExit()
|
defer XDC.ExpectExit()
|
||||||
|
|
@ -107,7 +107,7 @@ Repeat passphrase: {{.InputLine "foobar2"}}
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestWalletImport(t *testing.T) {
|
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()
|
defer XDC.ExpectExit()
|
||||||
XDC.Expect(`
|
XDC.Expect(`
|
||||||
!! Unsupported terminal, password will be echoed.
|
!! Unsupported terminal, password will be echoed.
|
||||||
|
|
@ -133,7 +133,7 @@ Fatal: could not decrypt key with given passphrase
|
||||||
|
|
||||||
func TestUnlockFlag(t *testing.T) {
|
func TestUnlockFlag(t *testing.T) {
|
||||||
datadir := tmpDatadirWithKeystore(t)
|
datadir := tmpDatadirWithKeystore(t)
|
||||||
XDC := runGeth(t,
|
XDC := runXDC(t,
|
||||||
"--datadir", datadir, "--nat", "none", "--nodiscover", "--maxpeers", "0", "--port", "0",
|
"--datadir", datadir, "--nat", "none", "--nodiscover", "--maxpeers", "0", "--port", "0",
|
||||||
"--unlock", "f466859ead1932d743d622cb74fc058882e8648a",
|
"--unlock", "f466859ead1932d743d622cb74fc058882e8648a",
|
||||||
"js", "testdata/empty.js")
|
"js", "testdata/empty.js")
|
||||||
|
|
@ -157,7 +157,7 @@ Passphrase: {{.InputLine "foobar"}}
|
||||||
|
|
||||||
func TestUnlockFlagWrongPassword(t *testing.T) {
|
func TestUnlockFlagWrongPassword(t *testing.T) {
|
||||||
datadir := tmpDatadirWithKeystore(t)
|
datadir := tmpDatadirWithKeystore(t)
|
||||||
XDC := runGeth(t,
|
XDC := runXDC(t,
|
||||||
"--datadir", datadir, "--nat", "none", "--nodiscover", "--maxpeers", "0", "--port", "0",
|
"--datadir", datadir, "--nat", "none", "--nodiscover", "--maxpeers", "0", "--port", "0",
|
||||||
"--unlock", "f466859ead1932d743d622cb74fc058882e8648a")
|
"--unlock", "f466859ead1932d743d622cb74fc058882e8648a")
|
||||||
defer XDC.ExpectExit()
|
defer XDC.ExpectExit()
|
||||||
|
|
@ -176,7 +176,7 @@ 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)
|
||||||
XDC := runGeth(t,
|
XDC := runXDC(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")
|
||||||
|
|
@ -203,7 +203,7 @@ Passphrase: {{.InputLine "foobar"}}
|
||||||
|
|
||||||
func TestUnlockFlagPasswordFile(t *testing.T) {
|
func TestUnlockFlagPasswordFile(t *testing.T) {
|
||||||
datadir := tmpDatadirWithKeystore(t)
|
datadir := tmpDatadirWithKeystore(t)
|
||||||
XDC := runGeth(t,
|
XDC := runXDC(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")
|
||||||
|
|
@ -223,7 +223,7 @@ func TestUnlockFlagPasswordFile(t *testing.T) {
|
||||||
|
|
||||||
func TestUnlockFlagPasswordFileWrongPassword(t *testing.T) {
|
func TestUnlockFlagPasswordFileWrongPassword(t *testing.T) {
|
||||||
datadir := tmpDatadirWithKeystore(t)
|
datadir := tmpDatadirWithKeystore(t)
|
||||||
XDC := runGeth(t,
|
XDC := runXDC(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 XDC.ExpectExit()
|
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) {
|
func TestUnlockFlagAmbiguous(t *testing.T) {
|
||||||
store := filepath.Join("..", "..", "accounts", "keystore", "testdata", "dupes")
|
store := filepath.Join("..", "..", "accounts", "keystore", "testdata", "dupes")
|
||||||
XDC := runGeth(t,
|
XDC := runXDC(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")
|
||||||
|
|
@ -272,7 +272,7 @@ 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")
|
||||||
XDC := runGeth(t,
|
XDC := runXDC(t,
|
||||||
"--keystore", store, "--nat", "none", "--nodiscover", "--maxpeers", "0", "--port", "0",
|
"--keystore", store, "--nat", "none", "--nodiscover", "--maxpeers", "0", "--port", "0",
|
||||||
"--unlock", "f466859ead1932d743d622cb74fc058882e8648a")
|
"--unlock", "f466859ead1932d743d622cb74fc058882e8648a")
|
||||||
defer XDC.ExpectExit()
|
defer XDC.ExpectExit()
|
||||||
|
|
|
||||||
|
|
@ -41,7 +41,7 @@ func TestConsoleWelcome(t *testing.T) {
|
||||||
coinbase := "0x8605cdbbdb6d264aa742e77020dcbc58fcdce182"
|
coinbase := "0x8605cdbbdb6d264aa742e77020dcbc58fcdce182"
|
||||||
|
|
||||||
// Start a XDC console, make sure it's cleaned up and terminate the console
|
// 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",
|
"--port", "0", "--maxpeers", "0", "--nodiscover", "--nat", "none",
|
||||||
"--etherbase", coinbase, "--shh",
|
"--etherbase", coinbase, "--shh",
|
||||||
"console")
|
"console")
|
||||||
|
|
@ -83,7 +83,7 @@ func TestIPCAttachWelcome(t *testing.T) {
|
||||||
}
|
}
|
||||||
// Note: we need --shh because testAttachWelcome checks for default
|
// Note: we need --shh because testAttachWelcome checks for default
|
||||||
// list of ipc modules and shh is included there.
|
// list of ipc modules and shh is included there.
|
||||||
XDC := runGeth(t,
|
XDC := runXDC(t,
|
||||||
"--port", "0", "--maxpeers", "0", "--nodiscover", "--nat", "none",
|
"--port", "0", "--maxpeers", "0", "--nodiscover", "--nat", "none",
|
||||||
"--etherbase", coinbase, "--shh", "--ipcpath", ipc)
|
"--etherbase", coinbase, "--shh", "--ipcpath", ipc)
|
||||||
|
|
||||||
|
|
@ -97,7 +97,7 @@ func TestIPCAttachWelcome(t *testing.T) {
|
||||||
func TestHTTPAttachWelcome(t *testing.T) {
|
func TestHTTPAttachWelcome(t *testing.T) {
|
||||||
coinbase := "0x8605cdbbdb6d264aa742e77020dcbc58fcdce182"
|
coinbase := "0x8605cdbbdb6d264aa742e77020dcbc58fcdce182"
|
||||||
port := strconv.Itoa(trulyRandInt(1024, 65536)) // Yeah, sometimes this will fail, sorry :P
|
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",
|
"--port", "0", "--maxpeers", "0", "--nodiscover", "--nat", "none",
|
||||||
"--etherbase", coinbase, "--rpc", "--rpcport", port)
|
"--etherbase", coinbase, "--rpc", "--rpcport", port)
|
||||||
|
|
||||||
|
|
@ -112,7 +112,7 @@ func TestWSAttachWelcome(t *testing.T) {
|
||||||
coinbase := "0x8605cdbbdb6d264aa742e77020dcbc58fcdce182"
|
coinbase := "0x8605cdbbdb6d264aa742e77020dcbc58fcdce182"
|
||||||
port := strconv.Itoa(trulyRandInt(1024, 65536)) // Yeah, sometimes this will fail, sorry :P
|
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",
|
"--port", "0", "--maxpeers", "0", "--nodiscover", "--nat", "none",
|
||||||
"--etherbase", coinbase, "--ws", "--wsport", port)
|
"--etherbase", coinbase, "--ws", "--wsport", port)
|
||||||
|
|
||||||
|
|
@ -125,7 +125,7 @@ func TestWSAttachWelcome(t *testing.T) {
|
||||||
|
|
||||||
func testAttachWelcome(t *testing.T, XDC *testXDC, endpoint, apis string) {
|
func testAttachWelcome(t *testing.T, XDC *testXDC, endpoint, apis string) {
|
||||||
// Attach to a running XDC note and terminate 1immediately
|
// Attach to a running XDC note and terminate 1immediately
|
||||||
attach := runGeth(t, "attach", endpoint)
|
attach := runXDC(t, "attach", endpoint)
|
||||||
defer attach.ExpectExit()
|
defer attach.ExpectExit()
|
||||||
attach.CloseStdin()
|
attach.CloseStdin()
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -112,11 +112,11 @@ func testDAOForkBlockNewChain(t *testing.T, test int, genesis string, expectBloc
|
||||||
if err := ioutil.WriteFile(json, []byte(genesis), 0600); err != nil {
|
if err := ioutil.WriteFile(json, []byte(genesis), 0600); err != nil {
|
||||||
t.Fatalf("test %d: failed to write genesis file: %v", test, err)
|
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 {
|
} else {
|
||||||
// Force chain initialization
|
// Force chain initialization
|
||||||
args := []string{"--port", "0", "--maxpeers", "0", "--nodiscover", "--nat", "none", "--ipcdisable", "--datadir", datadir}
|
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()
|
XDC.WaitExit()
|
||||||
}
|
}
|
||||||
// Retrieve the DAO config flag from the database
|
// Retrieve the DAO config flag from the database
|
||||||
|
|
|
||||||
|
|
@ -97,10 +97,10 @@ func TestCustomGenesis(t *testing.T) {
|
||||||
if err := ioutil.WriteFile(json, []byte(tt.genesis), 0600); err != nil {
|
if err := ioutil.WriteFile(json, []byte(tt.genesis), 0600); err != nil {
|
||||||
t.Fatalf("test %d: failed to write genesis file: %v", i, err)
|
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
|
// Query the custom genesis block
|
||||||
XDC := runGeth(t,
|
XDC := runXDC(t,
|
||||||
"--datadir", datadir, "--maxpeers", "0", "--port", "0",
|
"--datadir", datadir, "--maxpeers", "0", "--port", "0",
|
||||||
"--nodiscover", "--nat", "none", "--ipcdisable",
|
"--nodiscover", "--nat", "none", "--ipcdisable",
|
||||||
"--exec", tt.query, "console")
|
"--exec", tt.query, "console")
|
||||||
|
|
|
||||||
|
|
@ -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
|
// Welcome show summary of current Geth instance and some metadata about the
|
||||||
// console's available modules.
|
// console's available modules.
|
||||||
func (c *Console) Welcome() {
|
func (c *Console) Welcome() {
|
||||||
// Print some generic Geth metadata
|
// Print some generic XDC metadata
|
||||||
fmt.Fprintf(c.printer, "Welcome to the Geth JavaScript console!\n\n")
|
fmt.Fprintf(c.printer, "Welcome to the XinFin JavaScript console!\n\n")
|
||||||
c.jsre.Run(`
|
c.jsre.Run(`
|
||||||
console.log("instance: " + web3.version.node);
|
console.log("instance: " + web3.version.node);
|
||||||
console.log("coinbase: " + eth.coinbase);
|
console.log("coinbase: " + eth.coinbase);
|
||||||
|
|
|
||||||
|
|
@ -124,7 +124,7 @@ func (tt *TestCmd) matchExactOutput(want []byte) error {
|
||||||
// Find the mismatch position.
|
// Find the mismatch position.
|
||||||
for i := 0; i < n; i++ {
|
for i := 0; i < n; i++ {
|
||||||
if want[i] != buf[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)
|
buf[:i], buf[i:n], want)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue