v0.2.6-pre.010-fix.001

This commit is contained in:
2026-08-21 14:53:50 +02:00
parent 4dcdbfaa55
commit 6dcd278459
13 changed files with 280 additions and 45 deletions

View File

@@ -1,5 +1,5 @@
// file: crates/ksp-app-wallet-desk/src/wallet_session.rs
// version: 6
// version: 7
//! Durable root-scoped Wallet session lifecycle for Wallet Desk.
@@ -14,7 +14,7 @@ pub(crate) enum WalletSessionStateDto {
NoSelection,
/// One Wallet is selected but remains locked.
Locked,
/// One explicit unlock operation is running in Rust.
/// One explicit privileged Wallet operation is running in Rust.
PrivilegedOperation,
/// One Wallet is open with VIEW capability.
ViewOpen,
@@ -150,6 +150,15 @@ pub(crate) enum WalletSession {
/// Authorized VIEW handle retaining metadata capability only in Rust.
wallet: std::boxed::Box<ksp_wallet_lib::WalletView>,
},
/// One VIEW-authorized self-service mutation temporarily owns the handle outside the session mutex.
ViewOperation {
/// Native Wallet filename / root-scoped identifier.
wallet_id: String,
/// Full root-scoped filesystem path retained only in Rust.
path: std::path::PathBuf,
/// Authorized Solana identity used only to reject stale completion.
pubkey: ksp_core_lib::Pubkey,
},
/// One Wallet kept open with OWNER capability.
Owner {
/// Native Wallet filename / root-scoped identifier.
@@ -208,6 +217,11 @@ impl WalletSession {
state: WalletSessionStateDto::ViewOpen,
wallet_id: std::option::Option::Some(wallet_id.clone()),
},
Self::ViewOperation { wallet_id, .. } => WalletSessionDto {
filename: std::option::Option::Some(wallet_id.clone()),
state: WalletSessionStateDto::PrivilegedOperation,
wallet_id: std::option::Option::Some(wallet_id.clone()),
},
Self::Owner { wallet_id, .. } => WalletSessionDto {
filename: std::option::Option::Some(wallet_id.clone()),
state: WalletSessionStateDto::OwnerOpen,