Skip to content

Commit

Permalink
expose ResetOnboaring to lib and mobile
Browse files Browse the repository at this point in the history
  • Loading branch information
gravityblast committed Jun 11, 2019
1 parent 365bbff commit 487110c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/library.go
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ func NewOnboarding(n, mnemonicPhraseLength C.int) *C.char {
return C.CString(string(outBytes))
}

//ImportOnboardingAccount re-creates and imports an account created during onboarding.
// ImportOnboardingAccount re-creates and imports an account created during onboarding.
//export ImportOnboardingAccount
func ImportOnboardingAccount(id, password *C.char) *C.char {
info, mnemonic, err := statusBackend.AccountManager().ImportOnboardingAccount(C.GoString(id), C.GoString(password))
Expand All @@ -396,6 +396,12 @@ func ImportOnboardingAccount(id, password *C.char) *C.char {
return C.CString(string(outBytes))
}

// ResetOnboarding resets the current onboarding removing from memory all the generated keys.
//export ResetOnboarding
func ResetOnboarding() {
statusBackend.AccountManager().ResetOnboarding()
}

//VerifyAccountPassword verifies account password
//export VerifyAccountPassword
func VerifyAccountPassword(keyStoreDir, address, password *C.char) *C.char {
Expand Down
5 changes: 5 additions & 0 deletions mobile/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,11 @@ func ImportOnboardingAccount(id, password string) string {
return string(outBytes)
}

// ResetOnboarding resets the current onboarding removing from memory all the generated keys.
func ResetOnboarding() {
statusBackend.AccountManager().ResetOnboarding()
}

// VerifyAccountPassword verifies account password.
func VerifyAccountPassword(keyStoreDir, address, password string) string {
_, err := statusBackend.AccountManager().VerifyAccountPassword(keyStoreDir, address, password)
Expand Down

0 comments on commit 487110c

Please sign in to comment.