Skip to content

Commit

Permalink
accounts: replace passPHRASE with passWORD in any user interactions (e…
Browse files Browse the repository at this point in the history
  • Loading branch information
gzliudan committed Jan 24, 2025
1 parent 6a7b539 commit e90df44
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion accounts/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ var ErrNotSupported = errors.New("not supported")

// ErrInvalidPassphrase is returned when a decryption operation receives a bad
// passphrase.
var ErrInvalidPassphrase = errors.New("invalid passphrase")
var ErrInvalidPassphrase = errors.New("invalid password")

// ErrWalletAlreadyOpen is returned if a wallet is attempted to be opened the
// second time.
Expand Down
2 changes: 1 addition & 1 deletion accounts/keystore/keystore.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ import (
var (
ErrLocked = accounts.NewAuthNeededError("password or unlock")
ErrNoMatch = errors.New("no key for given address or file")
ErrDecrypt = errors.New("could not decrypt key with given passphrase")
ErrDecrypt = errors.New("could not decrypt key with given password")
)

// KeyStoreType is the reflect type of a keystore backend.
Expand Down
2 changes: 1 addition & 1 deletion accounts/keystore/plain_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ func TestKeyStorePassphraseDecryptionFail(t *testing.T) {
t.Fatal(err)
}
if _, err = ks.GetKey(k1.Address, account.URL.Path, "bar"); err != ErrDecrypt {
t.Fatalf("wrong error for invalid passphrase\ngot %q\nwant %q", err, ErrDecrypt)
t.Fatalf("wrong error for invalid password\ngot %q\nwant %q", err, ErrDecrypt)
}
}

Expand Down
2 changes: 1 addition & 1 deletion accounts/keystore/testdata/keystore/README
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
This directory contains accounts for testing.
The passphrase that unlocks them is "foobar".
The password that unlocks them is "foobar".

The "good" key files which are supposed to be loadable are:

Expand Down
6 changes: 3 additions & 3 deletions cmd/XDC/accountcmd_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ func TestWalletImportBadPassword(t *testing.T) {
XDC.Expect(`
!! Unsupported terminal, password will be echoed.
Passphrase: {{.InputLine "wrong"}}
Fatal: could not decrypt key with given passphrase
Fatal: could not decrypt key with given password
`)
}

Expand Down Expand Up @@ -219,7 +219,7 @@ Unlocking account f466859ead1932d743d622cb74fc058882e8648a | Attempt 2/3
Passphrase: {{.InputLine "wrong2"}}
Unlocking account f466859ead1932d743d622cb74fc058882e8648a | Attempt 3/3
Passphrase: {{.InputLine "wrong3"}}
Fatal: Failed to unlock account f466859ead1932d743d622cb74fc058882e8648a (could not decrypt key with given passphrase)
Fatal: Failed to unlock account f466859ead1932d743d622cb74fc058882e8648a (could not decrypt key with given password)
`)
}

Expand Down Expand Up @@ -281,7 +281,7 @@ func TestUnlockFlagPasswordFileWrongPassword(t *testing.T) {
"--password", "testdata/wrong-passwords.txt", "--unlock", "0,2")
defer XDC.ExpectExit()
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 password)
`)
}

Expand Down
2 changes: 1 addition & 1 deletion cmd/puppeth/wizard_faucet.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ func (w *wizard) deployFaucet() {
infos.node.keyPass = w.readPassword()

if _, err := keystore.DecryptKey([]byte(infos.node.keyJSON), infos.node.keyPass); err != nil {
log.Error("Failed to decrypt key with given passphrase")
log.Error("Failed to decrypt key with given password")
infos.node.keyJSON = ""
infos.node.keyPass = ""
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/puppeth/wizard_node.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ func (w *wizard) deployNode(boot bool) {
infos.keyPass = w.readPassword()

if _, err := keystore.DecryptKey([]byte(infos.keyJSON), infos.keyPass); err != nil {
log.Error("Failed to decrypt key with given passphrase")
log.Error("Failed to decrypt key with given password")
return
}
}
Expand Down

0 comments on commit e90df44

Please sign in to comment.