-
Notifications
You must be signed in to change notification settings - Fork 13
fix: centralize validation and fee-reserve hygiene, clean up error banners #927
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
Merged
Merged
Changes from 3 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
7d3feaf
fix: centralize validation and fee hygiene
lklimek 42764b1
Merge remote-tracking branch 'origin/v1.0-dev' into fix/g1-validation…
lklimek b0fa01b
Merge branch 'v1.0-dev' into fix/g1-validation-fee-hygiene
lklimek 05cb1b3
fix(wallets): validate HD alias before writing the seed envelope
lklimek 4a93449
fix(tokens): name the duplicated language, not the plural form
lklimek 6052881
fix(tools): surface concrete parse errors in the Transition Visualizer
lklimek 4acdd53
perf(identity): look up one identity directly in remove_identity
lklimek 3f21f4e
Merge remote-tracking branch 'origin/v1.0-dev' into wt-pr927-fix/g1-v…
lklimek 2d6abbd
fix(ui): use fee estimator for identity-list withdraw/transfer thresh…
lklimek File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| use crate::backend_task::{BackendTaskSuccessResult, TaskError}; | ||
| use crate::context::AppContext; | ||
| use dash_sdk::dpp::identity::accessors::IdentityGettersV0; | ||
| use dash_sdk::platform::Identifier; | ||
|
|
||
| impl AppContext { | ||
| pub(super) fn remove_identity( | ||
| &self, | ||
| identity_id: Identifier, | ||
| ) -> Result<BackendTaskSuccessResult, TaskError> { | ||
| let associated_voter_identity_id = self | ||
| .load_local_qualified_identities()? | ||
| .into_iter() | ||
| .find(|identity| identity.identity.id() == identity_id) | ||
| .and_then(|identity| { | ||
| identity | ||
| .associated_voter_identity | ||
| .map(|(voter_identity, _)| voter_identity.id()) | ||
| }); | ||
|
|
||
| self.delete_local_qualified_identity(&identity_id)?; | ||
|
|
||
| let mut removed_identity_ids = vec![identity_id]; | ||
| let mut associated_cleanup_failed = false; | ||
| if let Some(voter_id) = associated_voter_identity_id.filter(|id| *id != identity_id) { | ||
| match self.delete_local_qualified_identity(&voter_id) { | ||
| Ok(()) => removed_identity_ids.push(voter_id), | ||
| Err(error) => { | ||
| associated_cleanup_failed = true; | ||
| tracing::warn!( | ||
| ?error, | ||
| voter_identity_id = %voter_id, | ||
| "Associated voter identity cleanup failed" | ||
| ); | ||
| } | ||
| } | ||
| } | ||
|
|
||
| Ok(BackendTaskSuccessResult::RemovedIdentities { | ||
| identity_ids: removed_identity_ids, | ||
| associated_cleanup_failed, | ||
| }) | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.