Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DeleteAccount method #1671

Closed
wants to merge 1 commit into from
Closed

DeleteAccount method #1671

wants to merge 1 commit into from

Conversation

rasom
Copy link
Collaborator

@rasom rasom commented Nov 12, 2019

DeleteAccount method is added, it deletes account from
multiaccounts database and also removes account's DB file.
The method is needed for keycard reseting functionality.
status-im/status-mobile#9229

@ghost
Copy link

ghost commented Nov 12, 2019

Pull Request Checklist

  • Have you updated the documentation, if impacted (e.g. docs.status.im)?

@status-im-auto
Copy link
Member

status-im-auto commented Nov 12, 2019

Jenkins Builds

Click to see older builds (3)
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ a297050 #1 2019-11-12 10:37:10 ~46 sec linux 📦zip
✔️ a297050 #1 2019-11-12 10:42:10 ~5 min ios 📦zip
✔️ a297050 #1 2019-11-12 10:43:21 ~7 min android 📦aar
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ 91efdb9 #2 2019-11-12 10:44:24 ~44 sec linux 📦zip
✔️ 91efdb9 #2 2019-11-12 10:47:00 ~3 min ios 📦zip
✔️ 91efdb9 #2 2019-11-12 10:51:26 ~7 min android 📦aar
✔️ bde7022 #3 2019-11-12 11:56:15 ~42 sec linux 📦zip
✔️ bde7022 #3 2019-11-12 11:58:08 ~2 min ios 📦zip
✔️ bde7022 #3 2019-11-12 12:00:36 ~5 min android 📦aar

api/backend.go Outdated
}

path := accountDBPath(b.rootDataDir, address)
err = os.RemoveAll(path)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can just do return os.RemoveAll(path) I believe

@@ -383,6 +383,24 @@ func SaveAccountAndLogin(accountData, password, configJSON, subaccountData *C.ch
return makeJSONResponse(nil)
}

// DeleteAccount delete account's database and delete account from multiaccount database
//export DeleteAccount
func DeleteAccount(addressChars *C.char) *C.char {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we use RPC in this case? I believe the consensus is to use RPC when poissble

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hm, yes I think we can

DeleteAccount method is added, it deletes account from
multiaccounts database and also removes account's DB file.
The method is needed for keycard reseting functionality.
status-im/status-mobile#9229
return b.multiaccountsDB.DeleteAccount(address)
}

func accountDBPath(root string, address common.Address) string {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can move it at the bottom of the file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants