Files
ObsidianDragon/src/wallet/lite_wallet_lifecycle_ui_adapter.h
DanS 298ae52528 refactor(lite): drop 4 unused OOP wrapper classes over free functions
Each of these classes wrapped an existing free function with a one-line
delegating method and was never instantiated anywhere (verified: no references
outside their own translation unit, not even within their own .cpp beyond the
definition) — the redundant "wrapper layer" pattern CLAUDE.md warns against:

- LiteWalletLifecycleUiExecutionAdapter      -> executeLiteWalletLifecycleUiRequest
- LiteWalletServerSelectionUiExecutionAdapter -> executeLiteWalletServerSelectionUi
- LiteWalletServerLifecycleReadinessPlanner   -> evaluateLiteWalletServerLifecycleReadiness
- LiteBackendActivationReadinessAdapter       -> evaluateLiteBackendActivationReadiness

The live free functions (the actual entry points used by the UI/runtime) are
unchanged. Both targets build, test suite passes, source-hygiene clean.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-05 12:40:26 -05:00

135 lines
4.5 KiB
C++

#pragma once
#include "lite_wallet_server_selection_adapter.h"
#include "../config/settings.h"
#include <string>
#include <vector>
namespace dragonx {
namespace wallet {
enum class LiteWalletLifecycleUiExecutionStatus {
ReadyForFutureLifecycleRequest,
WaitingForLiteBuild,
WaitingForBackendCapability,
WaitingForSettings,
WaitingForPersistedServerSelection,
WaitingForServerSelection,
WaitingForDisplayStatus,
WaitingForLifecycleUi,
WaitingForRequest,
WaitingForPrivateDataRedaction,
WaitingForSyncPlannerFeed,
RuntimeExecutionDisabled
};
enum class LiteWalletLifecycleUiExecutionIssue {
FullNodeBuild,
LiteBackendCapabilityMissing,
SettingsNotLoaded,
PersistedServerSelectionIntentMissing,
ServerSelectionMissing,
SelectedServerDisplayMissing,
LifecycleUiOwnerMissing,
LifecycleOperationUnconfirmed,
OpenWalletPathMissing,
RestoreSeedMissing,
PrivateDataRedactionMissing,
SyncPlannerFeedMissing,
ServerConnectivityCheckRequested,
WalletExistsCheckRequested,
WalletLifecycleExecutionRequested,
SyncRequested,
SyncStatusPollingRequested,
WorkerQueueRequested,
WalletStateMutationRequested,
WalletFilePersistenceRequested,
SendImportExportRequested,
SettingsWriteRequested
};
struct LiteWalletLifecycleUiRequestIntent {
bool requestProvided = false;
LiteWalletLifecycleOperation operation = LiteWalletLifecycleOperation::CreateNew;
LiteWalletCreateRequest createRequest;
LiteWalletOpenRequest openRequest;
LiteWalletRestoreRequest restoreRequest;
};
struct LiteWalletLifecycleUiExecutionInput {
WalletCapabilities capabilities;
LiteWalletLifecycleUiRequestIntent request;
bool settingsLoaded = true;
bool requirePersistedServerSelectionIntent = true;
LiteWalletLifecycleUiPrerequisites ui;
bool settingsWriteRequested = false;
bool serverConnectivityCheckRequested = false;
bool walletExistsCheckRequested = false;
bool walletLifecycleExecutionRequested = false;
bool syncStartRequested = false;
bool syncStatusPollingRequested = false;
bool workerQueueEnqueueRequested = false;
bool walletStateMutationRequested = false;
bool walletFilePersistenceRequested = false;
bool sendImportExportExecutionRequested = false;
};
struct LiteWalletLifecycleUiExecutionIssueInfo {
LiteWalletLifecycleUiExecutionIssue issue = LiteWalletLifecycleUiExecutionIssue::SettingsNotLoaded;
std::string message;
};
struct LiteWalletLifecycleUiExecutionResult {
bool ok = false;
bool dryRunOnly = true;
bool noNetwork = true;
bool noBridgeCalls = true;
bool noServerHealthChecked = true;
bool noWalletExistsChecked = true;
bool noWalletCreated = true;
bool noWalletOpened = true;
bool noWalletRestored = true;
bool noSyncStarted = true;
bool noSyncStatusPolled = true;
bool noWalletPersistence = true;
bool noSettingsPersistence = true;
bool noSendImportExportExecution = true;
bool settingsWritten = false;
bool workerQueueEnqueued = false;
bool stateMutationAllowed = false;
bool stateMutated = false;
bool walletStateWritten = false;
bool selectedServerSettingsLoaded = false;
bool selectedServerIntentAccepted = false;
bool lifecycleReadinessAccepted = false;
bool requestAccepted = false;
bool privateDataRedacted = false;
bool lifecycleReportCouldFeedSyncPlanners = false;
LiteWalletLifecycleUiExecutionStatus status = LiteWalletLifecycleUiExecutionStatus::WaitingForSettings;
std::string error;
std::string selectedServerUrlRedacted;
std::string requestSummaryRedacted;
std::string diagnosticSummary;
LiteConnectionSettings connectionSettings;
LiteServerSelectionResult selectedServer;
LiteWalletServerSelectionUiExecutionResult serverSelectionReport;
LiteWalletServerLifecycleReadinessInput lifecycleInput;
LiteWalletServerLifecycleReadinessResult lifecycleReadiness;
std::vector<LiteRedactedPrivateData> privateData;
std::vector<LiteWalletLifecycleUiExecutionIssueInfo> issues;
};
const char* liteWalletLifecycleUiExecutionStatusName(
LiteWalletLifecycleUiExecutionStatus status);
const char* liteWalletLifecycleUiExecutionIssueName(
LiteWalletLifecycleUiExecutionIssue issue);
LiteWalletLifecycleUiExecutionResult executeLiteWalletLifecycleUiRequest(
config::Settings& settings,
const LiteWalletLifecycleUiExecutionInput& input);
} // namespace wallet
} // namespace dragonx