RemindAccountDetails() -> RecoverAccount()

This commit is contained in:
Victor Farazdagi 2016-08-24 18:10:42 +03:00
parent e1db1bbf44
commit 574f67999d
3 changed files with 9 additions and 9 deletions

View File

@ -82,7 +82,7 @@ func createAccount(password string) (string, string, string, error) {
return "", "", "", errors.New("No running node detected for account creation")
}
func remindAccountDetails(password, mnemonic string) (string, string, error) {
func recoverAccount(password, mnemonic string) (string, string, error) {
if currentNode != nil {

View File

@ -33,7 +33,7 @@ const (
whisperMessage5 = "test message 5 (K2 -> K1)"
)
func TestRemindAccountDetails(t *testing.T) {
func TestRecoverAccount(t *testing.T) {
err := prepareTestNode()
if err != nil {
t.Error(err)
@ -48,14 +48,14 @@ func TestRemindAccountDetails(t *testing.T) {
}
glog.V(logger.Info).Infof("Account created: {address: %s, key: %s, mnemonic:%s}", address, pubKey, mnemonic)
// try reminding using password + mnemonic
addressCheck, pubKeyCheck, err := remindAccountDetails(newAccountPassword, mnemonic)
// try recovering using password + mnemonic
addressCheck, pubKeyCheck, err := recoverAccount(newAccountPassword, mnemonic)
if err != nil {
t.Errorf("remind details failed: %v", err)
t.Errorf("recover account failed: %v", err)
return
}
if address != addressCheck || pubKey != pubKeyCheck {
t.Error("Test failed: remind account details failed to pull the correct details")
t.Error("Test failed: recover account details failed to pull the correct details")
}
}

View File

@ -34,10 +34,10 @@ func CreateAccount(password *C.char) *C.char {
return C.CString(string(outBytes))
}
//export RemindAccountDetails
func RemindAccountDetails(password, mnemonic *C.char) *C.char {
//export RecoverAccount
func RecoverAccount(password, mnemonic *C.char) *C.char {
address, pubKey, err := remindAccountDetails(C.GoString(password), C.GoString(mnemonic))
address, pubKey, err := recoverAccount(C.GoString(password), C.GoString(mnemonic))
errString := emptyError
if err != nil {