-
Notifications
You must be signed in to change notification settings - Fork 247
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
DeleteAccount method #1671
Conversation
Pull Request Checklist
|
Jenkins BuildsClick to see older builds (3)
|
a297050
to
91efdb9
Compare
api/backend.go
Outdated
} | ||
|
||
path := accountDBPath(b.rootDataDir, address) | ||
err = os.RemoveAll(path) |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
91efdb9
to
bde7022
Compare
return b.multiaccountsDB.DeleteAccount(address) | ||
} | ||
|
||
func accountDBPath(root string, address common.Address) string { |
There was a problem hiding this comment.
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.
a726462
to
330d177
Compare
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