Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions src/ui/dashpay/contact_requests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,10 @@ impl ContactRequests {
.id()
.to_string(dash_sdk::dpp::platform_value::string_encoding::Encoding::Base58);

// Get wallet for the selected identity
// Get wallet for the selected identity (don't show error on auto-select;
// some identities like evonodes may lack document signing keys)
new_self.selected_wallet =
get_selected_wallet(&identities[0], Some(&app_context), None)
.or_show_error(app_context.egui_ctx())
.unwrap_or(None);
get_selected_wallet(&identities[0], Some(&app_context), None).unwrap_or(None);

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Same rationale as the QRCodeGenerator comment above — the only other error is a missing DPNS contract, which is a global failure, not something worth special-casing here.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Fixed in a6bd8f3 — same selective handling as QRCodeGenerator: only the missing signing-key case is suppressed, other errors are shown.


// Load requests from database for this identity
new_self.load_requests_from_database();
Expand Down
7 changes: 3 additions & 4 deletions src/ui/dashpay/qr_code_generator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,10 @@ impl QRCodeGeneratorScreen {
new_self.selected_identity_string =
identities[0].identity.id().to_string(Encoding::Base58);

// Get wallet for the selected identity
// Get wallet for the selected identity (don't show error on auto-select;
// some identities like evonodes may lack document signing keys)
new_self.selected_wallet =
get_selected_wallet(&identities[0], Some(&app_context), None)
.or_show_error(app_context.egui_ctx())
.unwrap_or(None);
get_selected_wallet(&identities[0], Some(&app_context), None).unwrap_or(None);

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Fair point in theory, but in practice the only other error path here is DPNS preorder document type not found — which means the DPNS contract is broken/missing, and the app would fail in many other places too. Selectively filtering error types here adds complexity for a scenario that's already catastrophic. The current approach keeps the auto-select path clean.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Fixed in a6bd8f3 — startup auto-select now suppresses only the expected missing document-signing-key error and surfaces other get_selected_wallet errors with a banner.

}

new_self
Expand Down
13 changes: 11 additions & 2 deletions src/ui/identities/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,17 @@ pub fn get_selected_wallet(
qualified_identity
.document_signing_key(&preorder_document_type)
.ok_or_else(|| {
"Identity doesn't have an authentication key for signing document transitions"
.to_string()
use dash_sdk::dpp::identity::accessors::IdentityGettersV0;
let identity_label = qualified_identity
.alias
.as_deref()
.or_else(|| qualified_identity.dpns_names.first().map(|n| n.name.as_str()))
.unwrap_or("unknown");
format!(
"Identity '{}' ({}) doesn't have an authentication key for signing document transitions",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

claw remove quotes, and when no name found, put empty string. We will just have a few spaces when identity label is not availble.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Done — removed quotes and switched the fallback to empty string. 83f602c

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Done in 83f602c — removed quotes and switched to empty string when no name is found.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Done in a6bd8f3 — preserved the no-quotes formatting and empty-string fallback after the amended update.

identity_label,
qualified_identity.identity.id()
)
Comment on lines +95 to +112

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

The Display impl for Identifier outputs Base58 — same encoding used elsewhere in the UI. No mismatch here.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Fixed in a6bd8f3 — the identity id is now formatted explicitly with Encoding::Base58.

})?
Comment on lines +97 to 113

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

💬 Nitpick: Empty identity label produces a double space in the rendered message

When alias is None and dpns_names is empty, identity_label becomes "" (line 106 unwrap_or("")), so the formatted message reads "Identity (4ZmR…) doesn't have an authentication key for signing document transitions" — note the double space and dangling "Identity ". The recent a6bd8f37 commit intentionally chose "" over a placeholder like "Unknown", so the format must branch on whether a label exists.

💡 Suggested change
Suggested change
let identity_label = qualified_identity
.alias
.as_deref()
.or_else(|| {
qualified_identity
.dpns_names
.first()
.map(|n| n.name.as_str())
})
.unwrap_or("");
format!(
"Identity {} ({}) {}",
identity_label,
qualified_identity.identity.id().to_string(Encoding::Base58),
MISSING_DOCUMENT_SIGNING_KEY_MARKER,
)
})?
let identity_label = qualified_identity.alias.as_deref().or_else(|| {
qualified_identity
.dpns_names
.first()
.map(|n| n.name.as_str())
});
let id_b58 = qualified_identity.identity.id().to_string(Encoding::Base58);
match identity_label {
Some(label) => format!(
"Identity {} ({}) {}",
label, id_b58, MISSING_DOCUMENT_SIGNING_KEY_MARKER,
),
None => format!(
"Identity ({}) {}",
id_b58, MISSING_DOCUMENT_SIGNING_KEY_MARKER,
),
}

source: ['claude']

} else {
// Fallback: directly use the provided selected key.
Expand Down
Loading