-
Notifications
You must be signed in to change notification settings - Fork 0
Account delete #3
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
base: main
Are you sure you want to change the base?
Conversation
src/store/mod.rs
Outdated
| .map_err(StoreError::QueryError) | ||
| } | ||
|
|
||
| pub fn remove_account(&self, account_id: u64) -> Result<(), StoreError> { |
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.
Let's make sure related objects are deleted as well for this command. In the future this can be optional if we see a scenario where it's positive to eliminate only partial data related to an account.
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.
Added in latest commit, I'm unsure what to do with the associated row on the account_code table, should we only remove it if no other account makes use of it?
| let q = self | ||
| .db | ||
| .execute( | ||
| "DELETE FROM accounts WHERE id = ?", |
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.
If it's simple enough, it would be nice to see a test that tests this function.
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.
Yes, to do this we should merge this branch with cli testing
Adds
account deletecommand to the CLI.Test:
cargo run --release --features testing -- account new fungible-faucet -t TEST -d 10 -m 10000cargo run --release --features testing -- account listcargo run --release --features testing -- account -r 0x880448d77a6ec824Pending unit test