This commit is contained in:
AnilChinchawale 2018-05-28 16:17:11 +05:30
parent dd02e14d42
commit c095cc3e6f
6 changed files with 25 additions and 25 deletions

View file

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

View file

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

View file

@ -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

View file

@ -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")

View file

@ -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);

View file

@ -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)
}
}