feat(lite): startup unlock prompt + real-backend encryption verification
Startup lock screen (soft): once the first refresh reveals the auto-opened wallet is encrypted+locked, show the unlock modal on launch (reusing renderLiteUnlockPrompt, one-shot per session). Soft by design — balances stay viewable via viewing keys while locked, so the user may dismiss and browse read-only; only spending needs the passphrase. Real-backend verification: add `lite_smoke --encrypt` (create -> encryptionstatus -> encrypt -> lock -> unlock, checking flags; passphrase never printed). Running it against the real SDXL backend showed encrypt LOCKS immediately (after encrypt: encrypted=1, locked=1) — the backend removes spending keys right after encrypting. The controller already relays encryptionstatus faithfully (UI is state-driven, so unaffected), but the fake modeled encrypt->unlocked; corrected the fake (encrypt -> encrypted+locked) and the test sequence (encrypt -> unlock -> lock -> decrypt) to match real behavior. Builds clean, tests pass, hygiene clean. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -128,10 +128,11 @@ inline char* liteFakeExecute(const char* command, const char* args)
|
||||
++g_liteFakeSaveCount;
|
||||
return liteFakeDup("{\"result\":\"success\"}");
|
||||
}
|
||||
// Encryption state machine. encrypt -> encrypted (keys stay in memory this session);
|
||||
// lock/unlock toggle locked; decrypt clears it; encryptionstatus reports {encrypted,locked}.
|
||||
// Encryption state machine. encrypt -> encrypted AND locked (matches the real backend,
|
||||
// which removes keys from memory right after encrypting — verified via lite_smoke --encrypt);
|
||||
// unlock/lock toggle locked; decrypt clears it; encryptionstatus reports {encrypted,locked}.
|
||||
if (std::strcmp(c, "encrypt") == 0) {
|
||||
g_liteFakeEncrypted = true; g_liteFakeLocked = false;
|
||||
g_liteFakeEncrypted = true; g_liteFakeLocked = true;
|
||||
return liteFakeDup("{\"result\":\"success\"}");
|
||||
}
|
||||
if (std::strcmp(c, "unlock") == 0) {
|
||||
|
||||
Reference in New Issue
Block a user