pub fn wallet_mode(bootstrap: &ConfigBootstrap, boot_mode: WalletBoot) -> WalletMode {
    // Recovery mode
    if matches!(boot_mode, WalletBoot::Recovery) {
        if bootstrap.daemon_mode {
            return WalletMode::RecoveryDaemon;
        } else {
            return WalletMode::RecoveryTui;
        }
    }

    match (
        bootstrap.daemon_mode,
        bootstrap.input_file.clone(),
        bootstrap.command.clone(),
    ) {
        // TUI mode
        (false, None, None) => WalletMode::Tui,
        // GRPC daemon mode
        (true, None, None) => WalletMode::Grpc,
        // Script mode
        (_, Some(path), None) => WalletMode::Script(path),
        // Command mode
        (_, None, Some(command)) => WalletMode::Command(command),
        // Invalid combinations
        _ => WalletMode::Invalid,
    }
}
/// Determines which mode the wallet should run in.
Determines which mode the wallet should run in.
Determines which mode the wallet should run in .
pub fn wallet_mode(bootstrap: &ConfigBootstrap, boot_mode: WalletBoot) -> WalletMode {
    // Recovery mode
    if matches!(boot_mode, WalletBoot::Recovery) {
        if bootstrap.daemon_mode {
            return WalletMode::RecoveryDaemon;
        } else {
            return WalletMode::RecoveryTui;
        }
    }
    match (
        bootstrap.daemon_mode,
        bootstrap.input_file.clone(),
        bootstrap.command.clone(),
    ) {
        // TUI mode
        (false, None, None) => WalletMode::Tui,
        // GRPC daemon mode
        (true, None, None) => WalletMode::Grpc,
        // Script mode
        (_, Some(path), None) => WalletMode::Script(path),
        // Command mode
        (_, None, Some(command)) => WalletMode::Command(command),
        // Invalid combinations
        _ => WalletMode::Invalid,
    }
}
pub fn wallet_mode ( bootstrap : & ConfigBootstrap , boot_mode : WalletBoot ) -> WalletMode { // Recovery mode if matches ! ( boot_mode WalletBoot Recovery ) { if bootstrap . daemon_mode { return WalletMode :: RecoveryDaemon ; } else { return WalletMode :: RecoveryTui ; } } match ( bootstrap . daemon_mode , bootstrap . input_file . clone ( ) , bootstrap . command . clone ( ) , ) { // TUI mode ( false , None , None ) => WalletMode :: Tui , // GRPC daemon mode ( true , None , None ) => WalletMode :: Grpc , // Script mode ( _ , Some ( path ) , None ) => WalletMode :: Script ( path ) , // Command mode ( _ , None , Some ( command ) ) => WalletMode :: Command ( command ) , // Invalid combinations _ => WalletMode :: Invalid , } }
Determines which mode the wallet should run in.
Determines which mode the wallet should run in .
bootstrap
&ConfigBootstrap
boot_mode
WalletBoot
bootstrap
&ConfigBootstrap
boot_mode
WalletBoot