diff --git a/modules/Package.swift b/modules/Package.swift index 3a9583d..2922690 100644 --- a/modules/Package.swift +++ b/modules/Package.swift @@ -23,6 +23,7 @@ let package = Package( .library(name: "FeedbackGenerator", targets: ["FeedbackGenerator"]), .library(name: "FileManager", targets: ["FileManager"]), .library(name: "Generated", targets: ["Generated"]), + .library(name: "Home", targets: ["Home"]), .library(name: "ImportWallet", targets: ["ImportWallet"]), .library(name: "LocalAuthenticationHandler", targets: ["LocalAuthenticationHandler"]), .library(name: "LogsHandler", targets: ["LogsHandler"]), @@ -35,6 +36,7 @@ let package = Package( .library(name: "RecoveryPhraseDisplay", targets: ["RecoveryPhraseDisplay"]), .library(name: "RecoveryPhraseValidationFlow", targets: ["RecoveryPhraseValidationFlow"]), .library(name: "ReviewRequest", targets: ["ReviewRequest"]), + .library(name: "Root", targets: ["Root"]), .library(name: "Sandbox", targets: ["Sandbox"]), .library(name: "Scan", targets: ["Scan"]), .library(name: "SDKSynchronizer", targets: ["SDKSynchronizer"]), @@ -183,12 +185,27 @@ let package = Package( resources: [.process("Resources")] ), .target( - name: "LocalAuthenticationHandler", + name: "Home", dependencies: [ + "AudioServices", + "BalanceBreakdown", + "DiskSpaceChecker", "Generated", - .product(name: "ComposableArchitecture", package: "swift-composable-architecture") + "Models", + "Profile", + "ReviewRequest", + "Scan", + "SendFlow", + "Settings", + "SDKSynchronizer", + "UIComponents", + "Utils", + "WalletEventsFlow", + "ZcashSDKEnvironment", + .product(name: "ComposableArchitecture", package: "swift-composable-architecture"), + .product(name: "ZcashLightClientKit", package: "ZcashLightClientKit") ], - path: "Sources/Dependencies/LocalAuthenticationHandler" + path: "Sources/Features/Home" ), .target( name: "ImportWallet", @@ -204,6 +221,14 @@ let package = Package( ], path: "Sources/Features/ImportWallet" ), + .target( + name: "LocalAuthenticationHandler", + dependencies: [ + "Generated", + .product(name: "ComposableArchitecture", package: "swift-composable-architecture") + ], + path: "Sources/Dependencies/LocalAuthenticationHandler" + ), .target( name: "LogsHandler", dependencies: [ @@ -306,6 +331,34 @@ let package = Package( ], path: "Sources/Dependencies/ReviewRequest" ), + .target( + name: "Root", + dependencies: [ + "DatabaseFiles", + "Deeplink", + "DerivationTool", + "ExportLogs", + "Generated", + "Home", + "MnemonicClient", + "Models", + "OnboardingFlow", + "RecoveryPhraseDisplay", + "RecoveryPhraseValidationFlow", + "Sandbox", + "SDKSynchronizer", + "UIComponents", + "UserPreferencesStorage", + "Utils", + "WalletConfigProvider", + "WalletStorage", + "Welcome", + "ZcashSDKEnvironment", + .product(name: "ComposableArchitecture", package: "swift-composable-architecture"), + .product(name: "ZcashLightClientKit", package: "ZcashLightClientKit") + ], + path: "Sources/Features/Root" + ), .target( name: "Sandbox", dependencies: [ diff --git a/secant/Features/Home/HomeStore.swift b/modules/Sources/Features/Home/HomeStore.swift similarity index 75% rename from secant/Features/Home/HomeStore.swift rename to modules/Sources/Features/Home/HomeStore.swift index 49773a9..a519614 100644 --- a/secant/Features/Home/HomeStore.swift +++ b/modules/Sources/Features/Home/HomeStore.swift @@ -16,14 +16,15 @@ import Scan import Settings import SendFlow -typealias HomeStore = Store -typealias HomeViewStore = ViewStore +public typealias HomeStore = Store +public typealias HomeViewStore = ViewStore -struct HomeReducer: ReducerProtocol { +public struct HomeReducer: ReducerProtocol { private enum CancelId { case timer } + let networkType: NetworkType - struct State: Equatable { - enum Destination: Equatable { + public struct State: Equatable { + public enum Destination: Equatable { case balanceBreakdown case notEnoughFreeDiskSpace case profile @@ -32,48 +33,78 @@ struct HomeReducer: ReducerProtocol { case transactionHistory } - @PresentationState var alert: AlertState? - var balanceBreakdownState: BalanceBreakdownReducer.State - var destination: Destination? - var canRequestReview = false - var profileState: ProfileReducer.State - var requiredTransactionConfirmations = 0 - var scanState: ScanReducer.State - var sendState: SendFlowReducer.State - var settingsState: SettingsReducer.State - var shieldedBalance: Balance - var synchronizerStatusSnapshot: SyncStatusSnapshot - var walletConfig: WalletConfig - var walletEventsState: WalletEventsFlowReducer.State + @PresentationState public var alert: AlertState? + public var balanceBreakdownState: BalanceBreakdownReducer.State + public var destination: Destination? + public var canRequestReview = false + public var profileState: ProfileReducer.State + public var requiredTransactionConfirmations = 0 + public var scanState: ScanReducer.State + public var sendState: SendFlowReducer.State + public var settingsState: SettingsReducer.State + public var shieldedBalance: Balance + public var synchronizerStatusSnapshot: SyncStatusSnapshot + public var walletConfig: WalletConfig + public var walletEventsState: WalletEventsFlowReducer.State // TODO: [#311] - Get the ZEC price from the SDK, https://github.com/zcash/secant-ios-wallet/issues/311 - var zecPrice = Decimal(140.0) + public var zecPrice = Decimal(140.0) - var totalCurrencyBalance: Zatoshi { + public var totalCurrencyBalance: Zatoshi { Zatoshi.from(decimal: shieldedBalance.data.verified.decimalValue.decimalValue * zecPrice) } - var isSyncing: Bool { + public var isSyncing: Bool { if case .syncing = synchronizerStatusSnapshot.syncStatus { return true } return false } - var isUpToDate: Bool { + public var isUpToDate: Bool { if case .upToDate = synchronizerStatusSnapshot.syncStatus { return true } return false } - var isSendButtonDisabled: Bool { + public var isSendButtonDisabled: Bool { // If the destination is `.send` the button must be enabled // to avoid involuntary navigation pop. (self.destination != .send && self.isSyncing) || shieldedBalance.data.verified.amount == 0 } + + public init( + balanceBreakdownState: BalanceBreakdownReducer.State, + destination: Destination? = nil, + canRequestReview: Bool = false, + profileState: ProfileReducer.State, + requiredTransactionConfirmations: Int = 0, + scanState: ScanReducer.State, + sendState: SendFlowReducer.State, + settingsState: SettingsReducer.State, + shieldedBalance: Balance, + synchronizerStatusSnapshot: SyncStatusSnapshot, + walletConfig: WalletConfig, + walletEventsState: WalletEventsFlowReducer.State, + zecPrice: Decimal = Decimal(140.0) + ) { + self.balanceBreakdownState = balanceBreakdownState + self.destination = destination + self.canRequestReview = canRequestReview + self.profileState = profileState + self.requiredTransactionConfirmations = requiredTransactionConfirmations + self.scanState = scanState + self.sendState = sendState + self.settingsState = settingsState + self.shieldedBalance = shieldedBalance + self.synchronizerStatusSnapshot = synchronizerStatusSnapshot + self.walletConfig = walletConfig + self.walletEventsState = walletEventsState + self.zecPrice = zecPrice + } } - enum Action: Equatable { + public enum Action: Equatable { case alert(PresentationAction) case balanceBreakdown(BalanceBreakdownReducer.Action) case debugMenuStartup @@ -102,13 +133,17 @@ struct HomeReducer: ReducerProtocol { @Dependency(\.sdkSynchronizer) var sdkSynchronizer @Dependency(\.zcashSDKEnvironment) var zcashSDKEnvironment - var body: some ReducerProtocol { + public init(networkType: NetworkType) { + self.networkType = networkType + } + + public var body: some ReducerProtocol { Scope(state: \.walletEventsState, action: /Action.walletEvents) { WalletEventsFlowReducer() } Scope(state: \.sendState, action: /Action.send) { - SendFlowReducer(networkType: TargetConstants.zcashNetwork.networkType) + SendFlowReducer(networkType: networkType) } Scope(state: \.settingsState, action: /Action.settings) { @@ -120,7 +155,7 @@ struct HomeReducer: ReducerProtocol { } Scope(state: \.balanceBreakdownState, action: /Action.balanceBreakdown) { - BalanceBreakdownReducer(networkType: TargetConstants.zcashNetwork.networkType) + BalanceBreakdownReducer(networkType: networkType) } Reduce { state, action in @@ -303,7 +338,7 @@ extension HomeViewStore { // MARK: Alerts extension AlertState where Action == HomeReducer.Action { - static func syncFailed(_ error: ZcashError, _ secondaryButtonTitle: String) -> AlertState { + public static func syncFailed(_ error: ZcashError, _ secondaryButtonTitle: String) -> AlertState { AlertState { TextState(L10n.Home.SyncFailed.title) } actions: { @@ -322,7 +357,7 @@ extension AlertState where Action == HomeReducer.Action { // MARK: Placeholders extension HomeReducer.State { - static var placeholder: Self { + public static var placeholder: Self { .init( balanceBreakdownState: .placeholder, profileState: .placeholder, @@ -338,14 +373,14 @@ extension HomeReducer.State { } extension HomeStore { - static var placeholder: HomeStore { + public static var placeholder: HomeStore { HomeStore( initialState: .placeholder, - reducer: HomeReducer() + reducer: HomeReducer(networkType: .testnet) ) } - static var error: HomeStore { + public static var error: HomeStore { HomeStore( initialState: .init( balanceBreakdownState: .placeholder, @@ -360,7 +395,7 @@ extension HomeStore { walletConfig: .default, walletEventsState: .emptyPlaceHolder ), - reducer: HomeReducer() + reducer: HomeReducer(networkType: .testnet) ) } } diff --git a/secant/Features/Home/HomeView.swift b/modules/Sources/Features/Home/HomeView.swift similarity index 89% rename from secant/Features/Home/HomeView.swift rename to modules/Sources/Features/Home/HomeView.swift index fb14e5c..28d9375 100644 --- a/secant/Features/Home/HomeView.swift +++ b/modules/Sources/Features/Home/HomeView.swift @@ -8,10 +8,16 @@ import WalletEventsFlow import Settings import SendFlow -struct HomeView: View { - let store: Store +public struct HomeView: View { + let store: HomeStore + let tokenName: String - var body: some View { + public init(store: HomeStore, tokenName: String) { + self.store = store + self.tokenName = tokenName + } + + public var body: some View { WithViewStore(store) { viewStore in VStack { balance(viewStore) @@ -55,7 +61,7 @@ struct HomeView: View { destination: { BalanceBreakdownView( store: store.balanceBreakdownStore(), - tokenName: TargetConstants.tokenName + tokenName: tokenName ) } ) @@ -65,11 +71,11 @@ struct HomeView: View { ) .navigationLinkEmpty( isActive: viewStore.bindingForDestination(.transactionHistory), - destination: { WalletEventsFlowView(store: store.historyStore(), tokenName: TargetConstants.tokenName) } + destination: { WalletEventsFlowView(store: store.historyStore(), tokenName: tokenName) } ) .navigationLinkEmpty( isActive: viewStore.bindingForDestination(.send), - destination: { SendFlowView(store: store.sendStore(), tokenName: TargetConstants.tokenName) } + destination: { SendFlowView(store: store.sendStore(), tokenName: tokenName) } ) .navigationLinkEmpty( isActive: viewStore.bindingForDestination(.profile), @@ -100,7 +106,7 @@ extension HomeView { Button(action: { viewStore.send(.updateDestination(.send)) }, label: { - Text(L10n.Home.sendZec(TargetConstants.tokenName)) + Text(L10n.Home.sendZec(tokenName)) }) .activeButtonStyle .padding(.bottom, 30) @@ -114,7 +120,7 @@ extension HomeView { Button(action: { viewStore.send(.updateDestination(.profile)) }, label: { - Text(L10n.Home.receiveZec(TargetConstants.tokenName)) + Text(L10n.Home.receiveZec(tokenName)) }) .activeButtonStyle .padding(.bottom, 30) @@ -125,7 +131,7 @@ extension HomeView { Button { viewStore.send(.updateDestination(.balanceBreakdown)) } label: { - Text(L10n.balance(viewStore.shieldedBalance.data.verified.decimalString(), TargetConstants.tokenName)) + Text(L10n.balance(viewStore.shieldedBalance.data.verified.decimalString(), tokenName)) .font(.system(size: 32)) .fontWeight(.bold) } @@ -149,7 +155,7 @@ extension HomeView { struct HomeView_Previews: PreviewProvider { static var previews: some View { NavigationView { - HomeView(store: .placeholder) + HomeView(store: .placeholder, tokenName: "ZEC") } } } diff --git a/secant/Features/NotEnoughFreeSpace/NotEnoughFreeSpaceView.swift b/modules/Sources/Features/Home/Views/NotEnoughFreeSpaceView.swift similarity index 75% rename from secant/Features/NotEnoughFreeSpace/NotEnoughFreeSpaceView.swift rename to modules/Sources/Features/Home/Views/NotEnoughFreeSpaceView.swift index c5013e9..1878f48 100644 --- a/secant/Features/NotEnoughFreeSpace/NotEnoughFreeSpaceView.swift +++ b/modules/Sources/Features/Home/Views/NotEnoughFreeSpaceView.swift @@ -11,10 +11,14 @@ import ComposableArchitecture import UIComponents import Generated -struct NotEnoughFreeSpaceView: View { +public struct NotEnoughFreeSpaceView: View { let viewStore: HomeViewStore - var body: some View { + public init(viewStore: HomeViewStore) { + self.viewStore = viewStore + } + + public var body: some View { Text(L10n.Nefs.message) .applyScreenBackground() } diff --git a/secant/Features/Root/RootDebug.swift b/modules/Sources/Features/Root/RootDebug.swift similarity index 90% rename from secant/Features/Root/RootDebug.swift rename to modules/Sources/Features/Root/RootDebug.swift index dc068be..d3c243a 100644 --- a/secant/Features/Root/RootDebug.swift +++ b/modules/Sources/Features/Root/RootDebug.swift @@ -15,11 +15,11 @@ import Models /// In this file is a collection of helpers that control all state and action related operations /// for the `RootReducer` with a connection to the UI navigation. extension RootReducer { - struct DebugState: Equatable { - var rescanDialog: ConfirmationDialogState? + public struct DebugState: Equatable { + public var rescanDialog: ConfirmationDialogState? } - indirect enum DebugAction: Equatable { + public indirect enum DebugAction: Equatable { case cancelRescan case cantStartSync(ZcashError) case flagUpdated @@ -34,11 +34,12 @@ extension RootReducer { } // swiftlint:disable:next cyclomatic_complexity - func debugReduce() -> Reduce { + public func debugReduce() -> Reduce { Reduce { state, action in switch action { case .debug(.testCrashReporter): - crashReporter.testCrash() + // TODO: [#747] crashReporter needs a bit of extra work, see https://github.com/zcash/secant-ios-wallet/issues/747 + //crashReporter.testCrash() return .none case .debug(.rescanBlockchain): @@ -124,7 +125,7 @@ extension RootReducer { // MARK: Placeholders extension RootReducer.DebugState { - static var placeholder: Self { + public static var placeholder: Self { .init() } } diff --git a/secant/Features/Root/RootDestination.swift b/modules/Sources/Features/Root/RootDestination.swift similarity index 89% rename from secant/Features/Root/RootDestination.swift rename to modules/Sources/Features/Root/RootDestination.swift index e277218..07d9553 100644 --- a/secant/Features/Root/RootDestination.swift +++ b/modules/Sources/Features/Root/RootDestination.swift @@ -14,8 +14,8 @@ import DerivationTool /// In this file is a collection of helpers that control all state and action related operations /// for the `RootReducer` with a connection to the UI navigation. extension RootReducer { - struct DestinationState: Equatable { - enum Destination: Equatable { + public struct DestinationState: Equatable { + public enum Destination: Equatable { case home case onboarding case phraseDisplay @@ -25,10 +25,10 @@ extension RootReducer { case welcome } - var internalDestination: Destination = .welcome - var previousDestination: Destination? + public var internalDestination: Destination = .welcome + public var previousDestination: Destination? - var destination: Destination { + public var destination: Destination { get { internalDestination } set { previousDestination = internalDestination @@ -37,7 +37,7 @@ extension RootReducer { } } - enum DestinationAction: Equatable { + public enum DestinationAction: Equatable { case deeplink(URL) case deeplinkHome case deeplinkSend(Zatoshi, String, String) @@ -46,7 +46,7 @@ extension RootReducer { } // swiftlint:disable:next cyclomatic_complexity - func destinationReduce() -> Reduce { + public func destinationReduce() -> Reduce { Reduce { state, action in switch action { case let .destination(.updateDestination(destination)): @@ -133,12 +133,12 @@ extension RootReducer { } private extension RootReducer { - func process( + public func process( url: URL, deeplink: DeeplinkClient, derivationTool: DerivationToolClient ) async throws -> RootReducer.Action { - let deeplink = try deeplink.resolveDeeplinkURL(url, TargetConstants.zcashNetwork.networkType, derivationTool) + let deeplink = try deeplink.resolveDeeplinkURL(url, zcashNetwork.networkType, derivationTool) switch deeplink { case .home: @@ -150,11 +150,11 @@ private extension RootReducer { } extension RootViewStore { - func goToDestination(_ destination: RootReducer.DestinationState.Destination) { + public func goToDestination(_ destination: RootReducer.DestinationState.Destination) { send(.destination(.updateDestination(destination))) } - func goToDeeplink(_ deeplink: URL) { + public func goToDeeplink(_ deeplink: URL) { send(.destination(.deeplink(deeplink))) } } @@ -162,7 +162,7 @@ extension RootViewStore { // MARK: Placeholders extension RootReducer.DestinationState { - static var placeholder: Self { + public static var placeholder: Self { .init() } } diff --git a/secant/Features/Root/RootInitialization.swift b/modules/Sources/Features/Root/RootInitialization.swift similarity index 94% rename from secant/Features/Root/RootInitialization.swift rename to modules/Sources/Features/Root/RootInitialization.swift index 5ccd0b3..41b582b 100644 --- a/secant/Features/Root/RootInitialization.swift +++ b/modules/Sources/Features/Root/RootInitialization.swift @@ -14,7 +14,7 @@ import Utils /// In this file is a collection of helpers that control all state and action related operations /// for the `RootReducer` with a connection to the app/wallet initialization and erasure of the wallet. extension RootReducer { - enum InitializationAction: Equatable { + public enum InitializationAction: Equatable { case appDelegate(AppDelegateAction) case checkBackupPhraseValidation case checkWalletInitialization @@ -31,7 +31,7 @@ extension RootReducer { } // swiftlint:disable:next cyclomatic_complexity function_body_length - func initializationReduce() -> Reduce { + public func initializationReduce() -> Reduce { Reduce { state, action in switch action { case .initialization(.appDelegate(.didFinishLaunching)): @@ -76,7 +76,8 @@ extension RootReducer { case .initialization(.checkWalletInitialization): let walletState = RootReducer.walletInitializationState( databaseFiles: databaseFiles, - walletStorage: walletStorage + walletStorage: walletStorage, + zcashNetwork: zcashNetwork ) return EffectTask(value: .initialization(.respondToWalletInitializationState(walletState))) @@ -119,12 +120,12 @@ extension RootReducer { return .none } - let birthday = state.storedWallet?.birthday?.value() ?? zcashSDKEnvironment.latestCheckpoint(TargetConstants.zcashNetwork) + let birthday = state.storedWallet?.birthday?.value() ?? zcashSDKEnvironment.latestCheckpoint(zcashNetwork) try mnemonic.isValid(storedWallet.seedPhrase.value()) let seedBytes = try mnemonic.toSeed(storedWallet.seedPhrase.value()) - let spendingKey = try derivationTool.deriveSpendingKey(seedBytes, 0, TargetConstants.zcashNetwork.networkType) - let viewingKey = try derivationTool.deriveUnifiedFullViewingKey(spendingKey, TargetConstants.zcashNetwork.networkType) + let spendingKey = try derivationTool.deriveSpendingKey(seedBytes, 0, zcashNetwork.networkType) + let viewingKey = try derivationTool.deriveUnifiedFullViewingKey(spendingKey, zcashNetwork.networkType) return .run { send in do { @@ -167,7 +168,7 @@ extension RootReducer { do { // get the random english mnemonic let newRandomPhrase = try mnemonic.randomMnemonic() - let birthday = zcashSDKEnvironment.latestCheckpoint(TargetConstants.zcashNetwork) + let birthday = zcashSDKEnvironment.latestCheckpoint(zcashNetwork) // store the wallet to the keychain try walletStorage.importWallet(newRandomPhrase, birthday, .english, !state.walletConfig.isEnabled(.testBackupPhraseFlow)) @@ -249,9 +250,10 @@ extension RootReducer { return EffectTask(value: .initialization(.createNewWallet)) case .initialization(.configureCrashReporter): - crashReporter.configure( - !userStoredPreferences.isUserOptedOutOfCrashReporting() - ) + // TODO: [#747] crashReporter needs a bit of extra work, see https://github.com/zcash/secant-ios-wallet/issues/747 +// crashReporter.configure( +// !userStoredPreferences.isUserOptedOutOfCrashReporting() +// ) return .none case .updateStateAfterConfigUpdate(let walletConfig): diff --git a/secant/Features/Root/RootStore.swift b/modules/Sources/Features/Root/RootStore.swift similarity index 63% rename from secant/Features/Root/RootStore.swift rename to modules/Sources/Features/Root/RootStore.swift index 79d09ab..1c2a8bf 100644 --- a/secant/Features/Root/RootStore.swift +++ b/modules/Sources/Features/Root/RootStore.swift @@ -15,32 +15,63 @@ import Foundation import ExportLogs import OnboardingFlow import Sandbox +import Home -typealias RootStore = Store -typealias RootViewStore = ViewStore +public typealias RootStore = Store +public typealias RootViewStore = ViewStore -struct RootReducer: ReducerProtocol { +public struct RootReducer: ReducerProtocol { enum CancelId { case timer } enum SynchronizerCancelId { case timer } enum WalletConfigCancelId { case timer } + let tokenName: String + let zcashNetwork: ZcashNetwork - struct State: Equatable { - @PresentationState var alert: AlertState? - var appInitializationState: InitializationState = .uninitialized - var debugState: DebugState - var destinationState: DestinationState - var exportLogsState: ExportLogsReducer.State - var homeState: HomeReducer.State - var onboardingState: OnboardingFlowReducer.State - var phraseValidationState: RecoveryPhraseValidationFlowReducer.State - var phraseDisplayState: RecoveryPhraseDisplayReducer.State - var sandboxState: SandboxReducer.State - var storedWallet: StoredWallet? - var walletConfig: WalletConfig - var welcomeState: WelcomeReducer.State + public struct State: Equatable { + @PresentationState public var alert: AlertState? + public var appInitializationState: InitializationState = .uninitialized + public var debugState: DebugState + public var destinationState: DestinationState + public var exportLogsState: ExportLogsReducer.State + public var homeState: HomeReducer.State + public var onboardingState: OnboardingFlowReducer.State + public var phraseValidationState: RecoveryPhraseValidationFlowReducer.State + public var phraseDisplayState: RecoveryPhraseDisplayReducer.State + public var sandboxState: SandboxReducer.State + public var storedWallet: StoredWallet? + public var walletConfig: WalletConfig + public var welcomeState: WelcomeReducer.State + + public init( + appInitializationState: InitializationState = .uninitialized, + debugState: DebugState, + destinationState: DestinationState, + exportLogsState: ExportLogsReducer.State, + homeState: HomeReducer.State, + onboardingState: OnboardingFlowReducer.State, + phraseValidationState: RecoveryPhraseValidationFlowReducer.State, + phraseDisplayState: RecoveryPhraseDisplayReducer.State, + sandboxState: SandboxReducer.State, + storedWallet: StoredWallet? = nil, + walletConfig: WalletConfig, + welcomeState: WelcomeReducer.State + ) { + self.appInitializationState = appInitializationState + self.debugState = debugState + self.destinationState = destinationState + self.exportLogsState = exportLogsState + self.homeState = homeState + self.onboardingState = onboardingState + self.phraseValidationState = phraseValidationState + self.phraseDisplayState = phraseDisplayState + self.sandboxState = sandboxState + self.storedWallet = storedWallet + self.walletConfig = walletConfig + self.welcomeState = welcomeState + } } - enum Action: Equatable { + public enum Action: Equatable { case alert(PresentationAction) case binding(BindingAction) case debug(DebugAction) @@ -60,7 +91,8 @@ struct RootReducer: ReducerProtocol { case welcome(WelcomeReducer.Action) } - @Dependency(\.crashReporter) var crashReporter + // TODO: [#747] crashReporter needs a bit of extra work, see https://github.com/zcash/secant-ios-wallet/issues/747 + //@Dependency(\.crashReporter) var crashReporter @Dependency(\.databaseFiles) var databaseFiles @Dependency(\.deeplink) var deeplink @Dependency(\.derivationTool) var derivationTool @@ -73,10 +105,15 @@ struct RootReducer: ReducerProtocol { @Dependency(\.walletStorage) var walletStorage @Dependency(\.zcashSDKEnvironment) var zcashSDKEnvironment + public init(tokenName: String, zcashNetwork: ZcashNetwork) { + self.tokenName = tokenName + self.zcashNetwork = zcashNetwork + } + @ReducerBuilder var core: some ReducerProtocol { Scope(state: \.homeState, action: /Action.home) { - HomeReducer() + HomeReducer(networkType: zcashNetwork.networkType) } Scope(state: \.exportLogsState, action: /Action.exportLogs) { @@ -84,7 +121,7 @@ struct RootReducer: ReducerProtocol { } Scope(state: \.onboardingState, action: /Action.onboarding) { - OnboardingFlowReducer(saplingActivationHeight: TargetConstants.zcashNetwork.constants.saplingActivationHeight) + OnboardingFlowReducer(saplingActivationHeight: zcashNetwork.constants.saplingActivationHeight) } Scope(state: \.phraseValidationState, action: /Action.phraseValidation) { @@ -110,21 +147,22 @@ struct RootReducer: ReducerProtocol { debugReduce() } - var body: some ReducerProtocol { + public var body: some ReducerProtocol { self.core } } extension RootReducer { - static func walletInitializationState( + public static func walletInitializationState( databaseFiles: DatabaseFilesClient, - walletStorage: WalletStorageClient + walletStorage: WalletStorageClient, + zcashNetwork: ZcashNetwork ) -> InitializationState { var keysPresent = false do { keysPresent = try walletStorage.areKeysPresent() let databaseFilesPresent = databaseFiles.areDbFilesPresentFor( - TargetConstants.zcashNetwork + zcashNetwork ) switch (keysPresent, databaseFilesPresent) { @@ -138,7 +176,7 @@ extension RootReducer { return .initialized } } catch WalletStorage.WalletStorageError.uninitializedWallet { - if databaseFiles.areDbFilesPresentFor(TargetConstants.zcashNetwork) { + if databaseFiles.areDbFilesPresentFor(zcashNetwork) { return .keysMissing } } catch { @@ -152,7 +190,7 @@ extension RootReducer { // MARK: Alerts extension AlertState where Action == RootReducer.Action { - static func cantCreateNewWallet(_ error: ZcashError) -> AlertState { + public static func cantCreateNewWallet(_ error: ZcashError) -> AlertState { AlertState { TextState(L10n.Root.Initialization.Alert.Failed.title) } message: { @@ -160,7 +198,7 @@ extension AlertState where Action == RootReducer.Action { } } - static func cantLoadSeedPhrase() -> AlertState { + public static func cantLoadSeedPhrase() -> AlertState { AlertState { TextState(L10n.Root.Initialization.Alert.Failed.title) } message: { @@ -168,7 +206,7 @@ extension AlertState where Action == RootReducer.Action { } } - static func cantStartSync(_ error: ZcashError) -> AlertState { + public static func cantStartSync(_ error: ZcashError) -> AlertState { AlertState { TextState(L10n.Root.Debug.Alert.Rewind.CantStartSync.title) } message: { @@ -176,7 +214,7 @@ extension AlertState where Action == RootReducer.Action { } } - static func cantStoreThatUserPassedPhraseBackupTest(_ error: ZcashError) -> AlertState { + public static func cantStoreThatUserPassedPhraseBackupTest(_ error: ZcashError) -> AlertState { AlertState { TextState(L10n.Root.Initialization.Alert.Failed.title) } message: { @@ -186,7 +224,7 @@ extension AlertState where Action == RootReducer.Action { } } - static func failedToProcessDeeplink(_ url: URL, _ error: ZcashError) -> AlertState { + public static func failedToProcessDeeplink(_ url: URL, _ error: ZcashError) -> AlertState { AlertState { TextState(L10n.Root.Destination.Alert.FailedToProcessDeeplink.title) } message: { @@ -194,7 +232,7 @@ extension AlertState where Action == RootReducer.Action { } } - static func initializationFailed(_ error: ZcashError) -> AlertState { + public static func initializationFailed(_ error: ZcashError) -> AlertState { AlertState { TextState(L10n.Root.Initialization.Alert.SdkInitFailed.title) } message: { @@ -202,7 +240,7 @@ extension AlertState where Action == RootReducer.Action { } } - static func rewindFailed(_ error: ZcashError) -> AlertState { + public static func rewindFailed(_ error: ZcashError) -> AlertState { AlertState { TextState(L10n.Root.Debug.Alert.Rewind.Failed.title) } message: { @@ -210,7 +248,7 @@ extension AlertState where Action == RootReducer.Action { } } - static func walletStateFailed(_ walletState: InitializationState) -> AlertState { + public static func walletStateFailed(_ walletState: InitializationState) -> AlertState { AlertState { TextState(L10n.Root.Initialization.Alert.Failed.title) } message: { @@ -218,13 +256,13 @@ extension AlertState where Action == RootReducer.Action { } } - static func wipeFailed() -> AlertState { + public static func wipeFailed() -> AlertState { AlertState { TextState(L10n.Root.Initialization.Alert.WipeFailed.title) } } - static func wipeRequest() -> AlertState { + public static func wipeRequest() -> AlertState { AlertState { TextState(L10n.Root.Initialization.Alert.Wipe.title) } actions: { @@ -243,7 +281,7 @@ extension AlertState where Action == RootReducer.Action { // MARK: Placeholders extension RootReducer.State { - static var placeholder: Self { + public static var placeholder: Self { .init( debugState: .placeholder, destinationState: .placeholder, @@ -265,10 +303,13 @@ extension RootReducer.State { } extension RootStore { - static var placeholder: RootStore { + public static var placeholder: RootStore { RootStore( initialState: .placeholder, - reducer: RootReducer().logging() + reducer: RootReducer( + tokenName: "ZEC", + zcashNetwork: ZcashNetworkBuilder.network(for: .testnet) + ).logging() ) } } diff --git a/secant/Features/Root/RootView.swift b/modules/Sources/Features/Root/RootView.swift similarity index 92% rename from secant/Features/Root/RootView.swift rename to modules/Sources/Features/Root/RootView.swift index 90db034..535f05d 100644 --- a/secant/Features/Root/RootView.swift +++ b/modules/Sources/Features/Root/RootView.swift @@ -9,11 +9,21 @@ import Welcome import ExportLogs import OnboardingFlow import Sandbox +import Home +import ZcashLightClientKit -struct RootView: View { +public struct RootView: View { let store: RootStore + let tokenName: String + let networkType: NetworkType - var body: some View { + public init(store: RootStore, tokenName: String, networkType: NetworkType) { + self.store = store + self.tokenName = tokenName + self.networkType = networkType + } + + public var body: some View { switchOverDestination() } } @@ -43,7 +53,8 @@ private extension RootView { store: store.scope( state: \.homeState, action: RootReducer.Action.home - ) + ), + tokenName: tokenName ) } .navigationViewStyle(.stack) @@ -55,8 +66,8 @@ private extension RootView { state: \.sandboxState, action: RootReducer.Action.sandbox ), - tokenName: TargetConstants.tokenName, - networkType: TargetConstants.zcashNetwork.networkType + tokenName: tokenName, + networkType: networkType ) } .navigationViewStyle(.stack) @@ -247,8 +258,10 @@ struct RootView_Previews: PreviewProvider { RootView( store: RootStore( initialState: .placeholder, - reducer: RootReducer() - ) + reducer: RootReducer(tokenName: "ZEC", zcashNetwork: ZcashNetworkBuilder.network(for: .testnet)) + ), + tokenName: "ZEC", + networkType: .testnet ) } } diff --git a/secant/Models/AppDelegate.swift b/modules/Sources/Models/AppDelegate.swift similarity index 100% rename from secant/Models/AppDelegate.swift rename to modules/Sources/Models/AppDelegate.swift diff --git a/secant/Models/InitializationState.swift b/modules/Sources/Models/InitializationState.swift similarity index 73% rename from secant/Models/InitializationState.swift rename to modules/Sources/Models/InitializationState.swift index 683bc52..df5bae2 100644 --- a/secant/Models/InitializationState.swift +++ b/modules/Sources/Models/InitializationState.swift @@ -7,7 +7,7 @@ import Foundation -enum InitializationState: Equatable { +public enum InitializationState: Equatable { case failed case initialized case keysMissing @@ -15,6 +15,6 @@ enum InitializationState: Equatable { case uninitialized } -enum SDKInitializationError: Error { +public enum SDKInitializationError: Error { case failed } diff --git a/secant/Models/SyncStatusSnapshot.swift b/modules/Sources/Models/SyncStatusSnapshot.swift similarity index 71% rename from secant/Models/SyncStatusSnapshot.swift rename to modules/Sources/Models/SyncStatusSnapshot.swift index 627a8d2..2a620cc 100644 --- a/secant/Models/SyncStatusSnapshot.swift +++ b/modules/Sources/Models/SyncStatusSnapshot.swift @@ -9,16 +9,16 @@ import Foundation import ZcashLightClientKit import Generated -struct SyncStatusSnapshot: Equatable { - let message: String - let syncStatus: SyncStatus +public struct SyncStatusSnapshot: Equatable { + public let message: String + public let syncStatus: SyncStatus - init(_ syncStatus: SyncStatus = .unprepared, _ message: String = "") { + public init(_ syncStatus: SyncStatus = .unprepared, _ message: String = "") { self.message = message self.syncStatus = syncStatus } - static func snapshotFor(state: SyncStatus) -> SyncStatusSnapshot { + public static func snapshotFor(state: SyncStatus) -> SyncStatusSnapshot { switch state { case .upToDate: return SyncStatusSnapshot(state, L10n.Sync.Message.uptodate) @@ -36,5 +36,5 @@ struct SyncStatusSnapshot: Equatable { } extension SyncStatusSnapshot { - static let `default` = SyncStatusSnapshot() + public static let `default` = SyncStatusSnapshot() } diff --git a/secant/Utils/Logging/TCALoggerReducer.swift b/modules/Sources/Utils/Logging/TCALoggerReducer.swift similarity index 100% rename from secant/Utils/Logging/TCALoggerReducer.swift rename to modules/Sources/Utils/Logging/TCALoggerReducer.swift diff --git a/secant/Utils/Logging/TCALogging.swift b/modules/Sources/Utils/Logging/TCALogging.swift similarity index 71% rename from secant/Utils/Logging/TCALogging.swift rename to modules/Sources/Utils/Logging/TCALogging.swift index bf7176d..14fea14 100644 --- a/secant/Utils/Logging/TCALogging.swift +++ b/modules/Sources/Utils/Logging/TCALogging.swift @@ -11,9 +11,9 @@ import ZcashLightClientKit import Utils extension OSLogger { - static let live = OSLogger(logLevel: .debug, category: LoggerConstants.tcaLogs) + public static let live = OSLogger(logLevel: .debug, category: LoggerConstants.tcaLogs) - func tcaDebug(_ message: String) { + public func tcaDebug(_ message: String) { guard let oslog else { return } os_log( diff --git a/secant.xcodeproj/project.pbxproj b/secant.xcodeproj/project.pbxproj index 5db615c..641cf02 100644 --- a/secant.xcodeproj/project.pbxproj +++ b/secant.xcodeproj/project.pbxproj @@ -12,30 +12,18 @@ 0D261040298C406F00CC9DE9 /* CrashReporterTestKey.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0D26103F298C406F00CC9DE9 /* CrashReporterTestKey.swift */; }; 0D26AE9D299E8196005260EE /* CrashReporterTestKey.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0D26103F298C406F00CC9DE9 /* CrashReporterTestKey.swift */; }; 0D26AEAA299E8196005260EE /* CrashReporterLiveKey.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0D26103D298C3FA600CC9DE9 /* CrashReporterLiveKey.swift */; }; - 0D26AEB1299E8196005260EE /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9EF8135F27F043CC0075AF48 /* AppDelegate.swift */; }; - 0D26AEC4299E8196005260EE /* TCALogging.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9E0F5740297E7F1C005304FA /* TCALogging.swift */; }; - 0D26AEC7299E8196005260EE /* RootInitialization.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9E9ADA7C2938F4C00071767B /* RootInitialization.swift */; }; - 0D26AED3299E8196005260EE /* SyncStatusSnapshot.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9E66122B2877188700C75B70 /* SyncStatusSnapshot.swift */; }; 0D26AEDC299E8196005260EE /* CheckCircle.swift in Sources */ = {isa = PBXBuildFile; fileRef = 346D41E328DF0B8600963F36 /* CheckCircle.swift */; }; 0D26AEE9299E8196005260EE /* WithStateBinding.swift in Sources */ = {isa = PBXBuildFile; fileRef = F9EEB8152742C2210032EEB8 /* WithStateBinding.swift */; }; - 0D26AEF0299E8196005260EE /* TCALoggerReducer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9E0F5742297EB96C005304FA /* TCALoggerReducer.swift */; }; - 0D26AEF3299E8196005260EE /* NotEnoughFreeSpaceView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3448CB3128E47666006ADEDB /* NotEnoughFreeSpaceView.swift */; }; 0D26AEF7299E8196005260EE /* Drawer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9E2F1C8E280EDE09004E65FE /* Drawer.swift */; }; 0D26AEFA299E8196005260EE /* DesignGuide.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0DB8AA80271DC7520035BC9D /* DesignGuide.swift */; }; - 0D26AEFC299E8196005260EE /* RootStore.swift in Sources */ = {isa = PBXBuildFile; fileRef = F9971A4A27680DC400A2DB75 /* RootStore.swift */; }; - 0D26AEFD299E8196005260EE /* HomeView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F93874EF273C4DE200F0E875 /* HomeView.swift */; }; - 0D26AF07299E8196005260EE /* RootView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F9971A4C27680DC400A2DB75 /* RootView.swift */; }; 0D26AF0F299E8196005260EE /* DebugFrame.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2EDA07A327EDE2A900D6F09B /* DebugFrame.swift */; }; 0D26AF11299E8196005260EE /* LottieAnimation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9E6612322878338C00C75B70 /* LottieAnimation.swift */; }; - 0D26AF1B299E8196005260EE /* HomeStore.swift in Sources */ = {isa = PBXBuildFile; fileRef = F93874ED273C4DE200F0E875 /* HomeStore.swift */; }; 0D26AF20299E8196005260EE /* UInt+SuperscriptText.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0DACFA8027208D940039EEA5 /* UInt+SuperscriptText.swift */; }; 0D26AF24299E8196005260EE /* SecantApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0D4E7A0826B364170058B01E /* SecantApp.swift */; }; 0D26AF3B299E8196005260EE /* CircularProgress.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9E7CB6142869E8C300A02233 /* CircularProgress.swift */; }; - 0D26AF40299E8196005260EE /* RootDestination.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9E9ADA7E2938F5EC0071767B /* RootDestination.swift */; }; 0D26AF44299E8196005260EE /* Memo+toString.swift in Sources */ = {isa = PBXBuildFile; fileRef = 34BF09082927C98000222134 /* Memo+toString.swift */; }; 0D26AF46299E8196005260EE /* CheckCircleStore.swift in Sources */ = {isa = PBXBuildFile; fileRef = 346715A428E2027D0035F7C4 /* CheckCircleStore.swift */; }; 0D26AF54299E8196005260EE /* CrashReporterInterface.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0D26103B298C3E4800CC9DE9 /* CrashReporterInterface.swift */; }; - 0D26AF65299E8196005260EE /* InitializationState.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9EF8139B27F47AED0075AF48 /* InitializationState.swift */; }; 0D26AF6A299E8196005260EE /* ClearBackgroundView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9E6713F9289BE0E100A6796F /* ClearBackgroundView.swift */; }; 0D26AF71299E8196005260EE /* Lottie in Frameworks */ = {isa = PBXBuildFile; productRef = 0D26AE8F299E8196005260EE /* Lottie */; }; 0D26AF72299E8196005260EE /* URLRouting in Frameworks */ = {isa = PBXBuildFile; productRef = 0D26AE93299E8196005260EE /* URLRouting */; }; @@ -56,7 +44,6 @@ 0DACFA8127208D940039EEA5 /* UInt+SuperscriptText.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0DACFA8027208D940039EEA5 /* UInt+SuperscriptText.swift */; }; 0DB8AA81271DC7520035BC9D /* DesignGuide.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0DB8AA80271DC7520035BC9D /* DesignGuide.swift */; }; 2EDA07A427EDE2A900D6F09B /* DebugFrame.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2EDA07A327EDE2A900D6F09B /* DebugFrame.swift */; }; - 3448CB3228E47666006ADEDB /* NotEnoughFreeSpaceView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3448CB3128E47666006ADEDB /* NotEnoughFreeSpaceView.swift */; }; 346715A528E2027D0035F7C4 /* CheckCircleStore.swift in Sources */ = {isa = PBXBuildFile; fileRef = 346715A428E2027D0035F7C4 /* CheckCircleStore.swift */; }; 346D41E428DF0B8600963F36 /* CheckCircle.swift in Sources */ = {isa = PBXBuildFile; fileRef = 346D41E328DF0B8600963F36 /* CheckCircle.swift */; }; 34BF09092927C98000222134 /* Memo+toString.swift in Sources */ = {isa = PBXBuildFile; fileRef = 34BF09082927C98000222134 /* Memo+toString.swift */; }; @@ -112,8 +99,6 @@ 9E0031C52A28BB97003DFCEB /* RecoveryPhraseDisplay in Frameworks */ = {isa = PBXBuildFile; productRef = 9E0031C42A28BB97003DFCEB /* RecoveryPhraseDisplay */; }; 9E0310B52A24A4CA0021F995 /* FileManager in Frameworks */ = {isa = PBXBuildFile; productRef = 9E0310B42A24A4CA0021F995 /* FileManager */; }; 9E0310C52A24A4E60021F995 /* FileManager in Frameworks */ = {isa = PBXBuildFile; productRef = 9E0310C42A24A4E60021F995 /* FileManager */; }; - 9E0F5741297E7F1D005304FA /* TCALogging.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9E0F5740297E7F1C005304FA /* TCALogging.swift */; }; - 9E0F5743297EB96C005304FA /* TCALoggerReducer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9E0F5742297EB96C005304FA /* TCALoggerReducer.swift */; }; 9E2AC0FF27D8EC120042AA47 /* MnemonicSwift in Frameworks */ = {isa = PBXBuildFile; productRef = 9E2AC0FE27D8EC120042AA47 /* MnemonicSwift */; }; 9E2F1C8C280ED6A7004E65FE /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 9E2F1C8B280ED6A7004E65FE /* LaunchScreen.storyboard */; }; 9E2F1C8F280EDE09004E65FE /* Drawer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9E2F1C8E280EDE09004E65FE /* Drawer.swift */; }; @@ -177,7 +162,6 @@ 9E54526A2A28D5570098B887 /* Welcome in Frameworks */ = {isa = PBXBuildFile; productRef = 9E5452692A28D5570098B887 /* Welcome */; }; 9E54526C2A28DA4B0098B887 /* Profile in Frameworks */ = {isa = PBXBuildFile; productRef = 9E54526B2A28DA4B0098B887 /* Profile */; }; 9E54526E2A28DA510098B887 /* Profile in Frameworks */ = {isa = PBXBuildFile; productRef = 9E54526D2A28DA510098B887 /* Profile */; }; - 9E66122C2877188700C75B70 /* SyncStatusSnapshot.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9E66122B2877188700C75B70 /* SyncStatusSnapshot.swift */; }; 9E6612312878337F00C75B70 /* Lottie in Frameworks */ = {isa = PBXBuildFile; productRef = 9E6612302878337F00C75B70 /* Lottie */; }; 9E6612332878338C00C75B70 /* LottieAnimation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9E6612322878338C00C75B70 /* LottieAnimation.swift */; }; 9E6612362878345000C75B70 /* endlessCircleProgress.json in Resources */ = {isa = PBXBuildFile; fileRef = 9E6612352878345000C75B70 /* endlessCircleProgress.json */; }; @@ -186,8 +170,6 @@ 9E7CB6152869E8C300A02233 /* CircularProgress.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9E7CB6142869E8C300A02233 /* CircularProgress.swift */; }; 9E80C44C2A25E8EC0049E6A7 /* MnemonicClient in Frameworks */ = {isa = PBXBuildFile; productRef = 9E80C44B2A25E8EC0049E6A7 /* MnemonicClient */; }; 9E80C4522A25E8FA0049E6A7 /* MnemonicClient in Frameworks */ = {isa = PBXBuildFile; productRef = 9E80C4512A25E8FA0049E6A7 /* MnemonicClient */; }; - 9E852D6129B098F400CF4AC1 /* RootDebug.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9E852D6029B098F400CF4AC1 /* RootDebug.swift */; }; - 9E852D6229B098F400CF4AC1 /* RootDebug.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9E852D6029B098F400CF4AC1 /* RootDebug.swift */; }; 9E9075022A2681F700269308 /* Generated in Frameworks */ = {isa = PBXBuildFile; productRef = 9E9075012A2681F700269308 /* Generated */; }; 9E9075042A2681FF00269308 /* Generated in Frameworks */ = {isa = PBXBuildFile; productRef = 9E9075032A2681FF00269308 /* Generated */; }; 9E9075062A2689D600269308 /* RecoveryPhraseValidationFlow in Frameworks */ = {isa = PBXBuildFile; productRef = 9E9075052A2689D600269308 /* RecoveryPhraseValidationFlow */; }; @@ -198,12 +180,8 @@ 9E9075142A2691B700269308 /* ZcashSDKEnvironment in Frameworks */ = {isa = PBXBuildFile; productRef = 9E9075132A2691B700269308 /* ZcashSDKEnvironment */; }; 9E90751E2A269BE300269308 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 9E90751D2A269BE300269308 /* Assets.xcassets */; }; 9E90751F2A269BE300269308 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 9E90751D2A269BE300269308 /* Assets.xcassets */; }; - 9E9ADA7D2938F4C00071767B /* RootInitialization.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9E9ADA7C2938F4C00071767B /* RootInitialization.swift */; }; - 9E9ADA7F2938F5EC0071767B /* RootDestination.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9E9ADA7E2938F5EC0071767B /* RootDestination.swift */; }; 9E9CEA3E29D47BE000599DF5 /* OnChangeReducer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9E9CEA3D29D47BE000599DF5 /* OnChangeReducer.swift */; }; 9EAB466D285A0468002904A0 /* Parsing in Frameworks */ = {isa = PBXBuildFile; productRef = 9EAB466C285A0468002904A0 /* Parsing */; }; - 9EAFEB9128081E9400199FC9 /* HomeStore.swift in Sources */ = {isa = PBXBuildFile; fileRef = F93874ED273C4DE200F0E875 /* HomeStore.swift */; }; - 9EAFEB9228081E9400199FC9 /* HomeView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F93874EF273C4DE200F0E875 /* HomeView.swift */; }; 9EB35D442A2F5F2A00A2149B /* ImportWallet in Frameworks */ = {isa = PBXBuildFile; productRef = 9EB35D432A2F5F2A00A2149B /* ImportWallet */; }; 9EB35D462A2F5F2F00A2149B /* ImportWallet in Frameworks */ = {isa = PBXBuildFile; productRef = 9EB35D452A2F5F2F00A2149B /* ImportWallet */; }; 9EB35D482A2F6B8700A2149B /* OnboardingFlow in Frameworks */ = {isa = PBXBuildFile; productRef = 9EB35D472A2F6B8700A2149B /* OnboardingFlow */; }; @@ -212,6 +190,10 @@ 9EB35D572A30656900A2149B /* SendFlow in Frameworks */ = {isa = PBXBuildFile; productRef = 9EB35D562A30656900A2149B /* SendFlow */; }; 9EB35D592A306C3E00A2149B /* Sandbox in Frameworks */ = {isa = PBXBuildFile; productRef = 9EB35D582A306C3E00A2149B /* Sandbox */; }; 9EB35D5B2A306C4300A2149B /* Sandbox in Frameworks */ = {isa = PBXBuildFile; productRef = 9EB35D5A2A306C4300A2149B /* Sandbox */; }; + 9EB35D5D2A31C3E100A2149B /* Home in Frameworks */ = {isa = PBXBuildFile; productRef = 9EB35D5C2A31C3E100A2149B /* Home */; }; + 9EB35D5F2A31C3E600A2149B /* Home in Frameworks */ = {isa = PBXBuildFile; productRef = 9EB35D5E2A31C3E600A2149B /* Home */; }; + 9EB35D612A31F1D800A2149B /* Root in Frameworks */ = {isa = PBXBuildFile; productRef = 9EB35D602A31F1D800A2149B /* Root */; }; + 9EB35D632A31F1DD00A2149B /* Root in Frameworks */ = {isa = PBXBuildFile; productRef = 9EB35D622A31F1DD00A2149B /* Root */; }; 9EE5926D2A2DDF94007147CD /* BalanceBreakdown in Frameworks */ = {isa = PBXBuildFile; productRef = 9EE5926C2A2DDF94007147CD /* BalanceBreakdown */; }; 9EE5926F2A2DDF98007147CD /* BalanceBreakdown in Frameworks */ = {isa = PBXBuildFile; productRef = 9EE5926E2A2DDF98007147CD /* BalanceBreakdown */; }; 9EE592712A2DF202007147CD /* WalletEventsFlow in Frameworks */ = {isa = PBXBuildFile; productRef = 9EE592702A2DF202007147CD /* WalletEventsFlow */; }; @@ -222,10 +204,6 @@ 9EE5927B2A2E0284007147CD /* Settings in Frameworks */ = {isa = PBXBuildFile; productRef = 9EE5927A2A2E0284007147CD /* Settings */; }; 9EE5927D2A2E0288007147CD /* ExportLogs in Frameworks */ = {isa = PBXBuildFile; productRef = 9EE5927C2A2E0288007147CD /* ExportLogs */; }; 9EE5927F2A2E028D007147CD /* Settings in Frameworks */ = {isa = PBXBuildFile; productRef = 9EE5927E2A2E028D007147CD /* Settings */; }; - 9EF8136027F043CC0075AF48 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9EF8135F27F043CC0075AF48 /* AppDelegate.swift */; }; - 9EF8139C27F47AED0075AF48 /* InitializationState.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9EF8139B27F47AED0075AF48 /* InitializationState.swift */; }; - F9971A4D27680DC400A2DB75 /* RootStore.swift in Sources */ = {isa = PBXBuildFile; fileRef = F9971A4A27680DC400A2DB75 /* RootStore.swift */; }; - F9971A4E27680DC400A2DB75 /* RootView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F9971A4C27680DC400A2DB75 /* RootView.swift */; }; F9EEB8162742C2210032EEB8 /* WithStateBinding.swift in Sources */ = {isa = PBXBuildFile; fileRef = F9EEB8152742C2210032EEB8 /* WithStateBinding.swift */; }; /* End PBXBuildFile section */ @@ -272,7 +250,6 @@ 2EDA07A327EDE2A900D6F09B /* DebugFrame.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DebugFrame.swift; sourceTree = ""; }; 341B30BA29B78D1000697081 /* HomeFeatureFlagTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HomeFeatureFlagTests.swift; sourceTree = ""; }; 34429C6D28E703CD00F2B929 /* TransactionSendingSnapshotTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TransactionSendingSnapshotTests.swift; sourceTree = ""; }; - 3448CB3128E47666006ADEDB /* NotEnoughFreeSpaceView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NotEnoughFreeSpaceView.swift; sourceTree = ""; }; 3448CB3628E485CB006ADEDB /* NotEnoughFeeSpaceSnapshots.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NotEnoughFeeSpaceSnapshots.swift; sourceTree = ""; }; 346715A428E2027D0035F7C4 /* CheckCircleStore.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CheckCircleStore.swift; sourceTree = ""; }; 3469F18129ACD70500A07146 /* OnboardingFlowFeatureFlagTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OnboardingFlowFeatureFlagTests.swift; sourceTree = ""; }; @@ -283,8 +260,6 @@ 6654C7432715A4AC00901167 /* OnboardingStoreTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OnboardingStoreTests.swift; sourceTree = ""; }; 9E01F8272833CDA0000EFC57 /* ScanTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ScanTests.swift; sourceTree = ""; }; 9E02B56B27FED475005B809B /* DatabaseFilesTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DatabaseFilesTests.swift; sourceTree = ""; }; - 9E0F5740297E7F1C005304FA /* TCALogging.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TCALogging.swift; sourceTree = ""; }; - 9E0F5742297EB96C005304FA /* TCALoggerReducer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TCALoggerReducer.swift; sourceTree = ""; }; 9E0F574A2980260D005304FA /* LoggerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LoggerTests.swift; sourceTree = ""; }; 9E207C352966EC77003E2C9B /* AddressDetailsSnapshotTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AddressDetailsSnapshotTests.swift; sourceTree = ""; }; 9E207C382966EF87003E2C9B /* AddressDetailsTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AddressDetailsTests.swift; sourceTree = ""; }; @@ -300,7 +275,6 @@ 9E5BF63E2819542C00BA3F17 /* WalletEventsTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WalletEventsTests.swift; sourceTree = ""; }; 9E5BF643281FEC9900BA3F17 /* SendTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SendTests.swift; sourceTree = ""; }; 9E612C7829913F3600D09B09 /* SensitiveDataTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SensitiveDataTests.swift; sourceTree = ""; }; - 9E66122B2877188700C75B70 /* SyncStatusSnapshot.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SyncStatusSnapshot.swift; sourceTree = ""; }; 9E6612322878338C00C75B70 /* LottieAnimation.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LottieAnimation.swift; sourceTree = ""; }; 9E6612352878345000C75B70 /* endlessCircleProgress.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = endlessCircleProgress.json; sourceTree = ""; }; 9E66129D288938A300C75B70 /* SettingsTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingsTests.swift; sourceTree = ""; }; @@ -313,14 +287,11 @@ 9E7CB6232874246800A02233 /* ProfileTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProfileTests.swift; sourceTree = ""; }; 9E7CB6262874269F00A02233 /* ProfileSnapshotTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProfileSnapshotTests.swift; sourceTree = ""; }; 9E852D5B29AF8EB200CF4AC1 /* RecoveryPhraseValidationFlowFeatureFlagTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RecoveryPhraseValidationFlowFeatureFlagTests.swift; sourceTree = ""; }; - 9E852D6029B098F400CF4AC1 /* RootDebug.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RootDebug.swift; sourceTree = ""; }; 9E852D6429B0A86300CF4AC1 /* DebugTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DebugTests.swift; sourceTree = ""; }; 9E90751D2A269BE300269308 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 9E92AF0728530EBF007367AD /* View+UIImage.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "View+UIImage.swift"; sourceTree = ""; }; 9E94C61F28AA7DEE008256E9 /* BalanceBreakdownTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BalanceBreakdownTests.swift; sourceTree = ""; }; 9E94C62228AA7EE0008256E9 /* BalanceBreakdownSnapshotTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BalanceBreakdownSnapshotTests.swift; sourceTree = ""; }; - 9E9ADA7C2938F4C00071767B /* RootInitialization.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RootInitialization.swift; sourceTree = ""; }; - 9E9ADA7E2938F5EC0071767B /* RootDestination.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RootDestination.swift; sourceTree = ""; }; 9E9CEA3D29D47BE000599DF5 /* OnChangeReducer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OnChangeReducer.swift; sourceTree = ""; }; 9E9ECC8C28589E150099D5A2 /* HomeSnapshotTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HomeSnapshotTests.swift; sourceTree = ""; }; 9E9ECC8E28589E150099D5A2 /* WelcomeSnapshotTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WelcomeSnapshotTests.swift; sourceTree = ""; }; @@ -337,12 +308,6 @@ 9EDDEAA12829610D00B4100C /* TransactionAddressInputTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TransactionAddressInputTests.swift; sourceTree = ""; }; 9EF8135A27ECC25E0075AF48 /* WalletStorageTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WalletStorageTests.swift; sourceTree = ""; }; 9EF8135B27ECC25E0075AF48 /* UserPreferencesStorageTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UserPreferencesStorageTests.swift; sourceTree = ""; }; - 9EF8135F27F043CC0075AF48 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; - 9EF8139B27F47AED0075AF48 /* InitializationState.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InitializationState.swift; sourceTree = ""; }; - F93874ED273C4DE200F0E875 /* HomeStore.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HomeStore.swift; sourceTree = ""; }; - F93874EF273C4DE200F0E875 /* HomeView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HomeView.swift; sourceTree = ""; }; - F9971A4A27680DC400A2DB75 /* RootStore.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RootStore.swift; sourceTree = ""; }; - F9971A4C27680DC400A2DB75 /* RootView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RootView.swift; sourceTree = ""; }; F9EEB8152742C2210032EEB8 /* WithStateBinding.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WithStateBinding.swift; sourceTree = ""; }; /* End PBXFileReference section */ @@ -353,6 +318,7 @@ files = ( 9E0031922A272A61003DFCEB /* NumberFormatter in Frameworks */, 9E0031902A272A61003DFCEB /* LogsHandler in Frameworks */, + 9EB35D632A31F1DD00A2149B /* Root in Frameworks */, 0D26AF71299E8196005260EE /* Lottie in Frameworks */, 9EE5927F2A2E028D007147CD /* Settings in Frameworks */, 9EB35D4A2A2F6B8B00A2149B /* OnboardingFlow in Frameworks */, @@ -380,6 +346,7 @@ 9E0031982A272AD7003DFCEB /* LocalAuthenticationHandler in Frameworks */, 9E0031762A272747003DFCEB /* Date in Frameworks */, 9E0031702A272746003DFCEB /* AudioServices in Frameworks */, + 9EB35D5D2A31C3E100A2149B /* Home in Frameworks */, 9E0031C52A28BB97003DFCEB /* RecoveryPhraseDisplay in Frameworks */, 9E0031782A272747003DFCEB /* Deeplink in Frameworks */, 0D26AF75299E8196005260EE /* MnemonicSwift in Frameworks */, @@ -407,6 +374,7 @@ files = ( 9E00318A2A272A52003DFCEB /* NumberFormatter in Frameworks */, 9E0031882A272A52003DFCEB /* LogsHandler in Frameworks */, + 9EB35D612A31F1D800A2149B /* Root in Frameworks */, 9E6612312878337F00C75B70 /* Lottie in Frameworks */, 9EE5927B2A2E0284007147CD /* Settings in Frameworks */, 9EB35D482A2F6B8700A2149B /* OnboardingFlow in Frameworks */, @@ -434,6 +402,7 @@ 9E0031962A272ACF003DFCEB /* LocalAuthenticationHandler in Frameworks */, 9E0031622A272736003DFCEB /* AudioServices in Frameworks */, 9E00316A2A272736003DFCEB /* Deeplink in Frameworks */, + 9EB35D5F2A31C3E600A2149B /* Home in Frameworks */, 9E0031C32A28BB92003DFCEB /* RecoveryPhraseDisplay in Frameworks */, 9E2AC0FF27D8EC120042AA47 /* MnemonicSwift in Frameworks */, 9E80C44C2A25E8EC0049E6A7 /* MnemonicClient in Frameworks */, @@ -498,11 +467,7 @@ 0D4E7A0726B364170058B01E /* secant */ = { isa = PBXGroup; children = ( - 0DA13CA326C1960A00E3B610 /* Models */, - 9E7FE0BB282D1DC200C374E8 /* Utils */, - 9E7FE0BD282D1DE100C374E8 /* Dependencies */, - 6654C73B2715A3F000901167 /* Features */, - 9E7FE0BE282D1DFE00C374E8 /* UI Components */, + 9EB35D642A31F65C00A2149B /* _Unmodularized */, 9E7FE0B6282D1D9800C374E8 /* Resources */, 0D4E7A0826B364170058B01E /* SecantApp.swift */, 9E2F1C8B280ED6A7004E65FE /* LaunchScreen.storyboard */, @@ -569,16 +534,6 @@ path = CrashReporter; sourceTree = ""; }; - 0DA13CA326C1960A00E3B610 /* Models */ = { - isa = PBXGroup; - children = ( - 9EF8135F27F043CC0075AF48 /* AppDelegate.swift */, - 9EF8139B27F47AED0075AF48 /* InitializationState.swift */, - 9E66122B2877188700C75B70 /* SyncStatusSnapshot.swift */, - ); - path = Models; - sourceTree = ""; - }; 0DFE93DD272C6D4B000FCCA5 /* BackupFlowTests */ = { isa = PBXGroup; children = ( @@ -604,14 +559,6 @@ name = Frameworks; sourceTree = ""; }; - 3448CB3028E4764E006ADEDB /* NotEnoughFreeSpace */ = { - isa = PBXGroup; - children = ( - 3448CB3128E47666006ADEDB /* NotEnoughFreeSpaceView.swift */, - ); - path = NotEnoughFreeSpace; - sourceTree = ""; - }; 346715A628E20FB30035F7C4 /* SendSnapshotTests */ = { isa = PBXGroup; children = ( @@ -637,16 +584,6 @@ path = WalletConfigProviderTests; sourceTree = ""; }; - 6654C73B2715A3F000901167 /* Features */ = { - isa = PBXGroup; - children = ( - F93874EC273C4DE200F0E875 /* Home */, - 3448CB3028E4764E006ADEDB /* NotEnoughFreeSpace */, - F9971A4927680DC400A2DB75 /* Root */, - ); - path = Features; - sourceTree = ""; - }; 6654C7422715A48E00901167 /* OnboardingTests */ = { isa = PBXGroup; children = ( @@ -664,15 +601,6 @@ path = ScanTests; sourceTree = ""; }; - 9E0F573F297E7F00005304FA /* Logging */ = { - isa = PBXGroup; - children = ( - 9E0F5740297E7F1C005304FA /* TCALogging.swift */, - 9E0F5742297EB96C005304FA /* TCALoggerReducer.swift */, - ); - path = Logging; - sourceTree = ""; - }; 9E207C342966EC60003E2C9B /* AddressDetailsSnapshotTests */ = { isa = PBXGroup; children = ( @@ -857,7 +785,6 @@ 9E486DF829BA09C2003E6945 /* UIKit+Extensions.swift */, 9E486DF229B9EEC4003E6945 /* UIResponder+Current.swift */, F9EEB8152742C2210032EEB8 /* WithStateBinding.swift */, - 9E0F573F297E7F00005304FA /* Logging */, ); path = Utils; sourceTree = ""; @@ -972,6 +899,16 @@ path = RootTests; sourceTree = ""; }; + 9EB35D642A31F65C00A2149B /* _Unmodularized */ = { + isa = PBXGroup; + children = ( + 9E7FE0BB282D1DC200C374E8 /* Utils */, + 9E7FE0BD282D1DE100C374E8 /* Dependencies */, + 9E7FE0BE282D1DFE00C374E8 /* UI Components */, + ); + path = _Unmodularized; + sourceTree = ""; + }; 9EF8135927ECC25E0075AF48 /* UtilTests */ = { isa = PBXGroup; children = ( @@ -986,27 +923,6 @@ path = UtilTests; sourceTree = ""; }; - F93874EC273C4DE200F0E875 /* Home */ = { - isa = PBXGroup; - children = ( - F93874ED273C4DE200F0E875 /* HomeStore.swift */, - F93874EF273C4DE200F0E875 /* HomeView.swift */, - ); - path = Home; - sourceTree = ""; - }; - F9971A4927680DC400A2DB75 /* Root */ = { - isa = PBXGroup; - children = ( - F9971A4A27680DC400A2DB75 /* RootStore.swift */, - F9971A4C27680DC400A2DB75 /* RootView.swift */, - 9E9ADA7E2938F5EC0071767B /* RootDestination.swift */, - 9E9ADA7C2938F4C00071767B /* RootInitialization.swift */, - 9E852D6029B098F400CF4AC1 /* RootDebug.swift */, - ); - path = Root; - sourceTree = ""; - }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ @@ -1075,6 +991,8 @@ 9EB35D492A2F6B8B00A2149B /* OnboardingFlow */, 9EB35D542A30656400A2149B /* SendFlow */, 9EB35D5A2A306C4300A2149B /* Sandbox */, + 9EB35D5C2A31C3E100A2149B /* Home */, + 9EB35D622A31F1DD00A2149B /* Root */, ); productName = secant; productReference = 0D26AF94299E8196005260EE /* secant-mainnet.app */; @@ -1145,6 +1063,8 @@ 9EB35D472A2F6B8700A2149B /* OnboardingFlow */, 9EB35D562A30656900A2149B /* SendFlow */, 9EB35D582A306C3E00A2149B /* Sandbox */, + 9EB35D5E2A31C3E600A2149B /* Home */, + 9EB35D602A31F1D800A2149B /* Root */, ); productName = secant; productReference = 0D4E7A0526B364170058B01E /* secant-testnet.app */; @@ -1461,34 +1381,21 @@ files = ( 0D26AE9D299E8196005260EE /* CrashReporterTestKey.swift in Sources */, 0D26AEAA299E8196005260EE /* CrashReporterLiveKey.swift in Sources */, - 0D26AEB1299E8196005260EE /* AppDelegate.swift in Sources */, - 0D26AEC4299E8196005260EE /* TCALogging.swift in Sources */, 9E486DFA29BA09C2003E6945 /* UIKit+Extensions.swift in Sources */, 9E33ECDA29D5E30700708DE4 /* OnChangeReducer.swift in Sources */, - 0D26AEC7299E8196005260EE /* RootInitialization.swift in Sources */, - 0D26AED3299E8196005260EE /* SyncStatusSnapshot.swift in Sources */, 0D26AEDC299E8196005260EE /* CheckCircle.swift in Sources */, 0D26AEE9299E8196005260EE /* WithStateBinding.swift in Sources */, - 0D26AEF0299E8196005260EE /* TCALoggerReducer.swift in Sources */, - 0D26AEF3299E8196005260EE /* NotEnoughFreeSpaceView.swift in Sources */, 0D26AEF7299E8196005260EE /* Drawer.swift in Sources */, 0D26AEFA299E8196005260EE /* DesignGuide.swift in Sources */, - 0D26AEFC299E8196005260EE /* RootStore.swift in Sources */, - 0D26AEFD299E8196005260EE /* HomeView.swift in Sources */, - 9E852D6229B098F400CF4AC1 /* RootDebug.swift in Sources */, - 0D26AF07299E8196005260EE /* RootView.swift in Sources */, 0D26AF0F299E8196005260EE /* DebugFrame.swift in Sources */, 0D26AF11299E8196005260EE /* LottieAnimation.swift in Sources */, 9E486DF129B9EE84003E6945 /* KeyboardAdaptive.swift in Sources */, - 0D26AF1B299E8196005260EE /* HomeStore.swift in Sources */, 0D26AF20299E8196005260EE /* UInt+SuperscriptText.swift in Sources */, 0D26AF24299E8196005260EE /* SecantApp.swift in Sources */, 0D26AF3B299E8196005260EE /* CircularProgress.swift in Sources */, - 0D26AF40299E8196005260EE /* RootDestination.swift in Sources */, 0D26AF44299E8196005260EE /* Memo+toString.swift in Sources */, 0D26AF46299E8196005260EE /* CheckCircleStore.swift in Sources */, 0D26AF54299E8196005260EE /* CrashReporterInterface.swift in Sources */, - 0D26AF65299E8196005260EE /* InitializationState.swift in Sources */, 9E486DF429B9EEC4003E6945 /* UIResponder+Current.swift in Sources */, 0D26AF6A299E8196005260EE /* ClearBackgroundView.swift in Sources */, ); @@ -1500,34 +1407,21 @@ files = ( 0D261040298C406F00CC9DE9 /* CrashReporterTestKey.swift in Sources */, 0D26103E298C3FA600CC9DE9 /* CrashReporterLiveKey.swift in Sources */, - 9EF8136027F043CC0075AF48 /* AppDelegate.swift in Sources */, - 9E0F5741297E7F1D005304FA /* TCALogging.swift in Sources */, 9E9CEA3E29D47BE000599DF5 /* OnChangeReducer.swift in Sources */, 9E486DF929BA09C2003E6945 /* UIKit+Extensions.swift in Sources */, - 9E9ADA7D2938F4C00071767B /* RootInitialization.swift in Sources */, - 9E66122C2877188700C75B70 /* SyncStatusSnapshot.swift in Sources */, 346D41E428DF0B8600963F36 /* CheckCircle.swift in Sources */, F9EEB8162742C2210032EEB8 /* WithStateBinding.swift in Sources */, - 9E0F5743297EB96C005304FA /* TCALoggerReducer.swift in Sources */, - 3448CB3228E47666006ADEDB /* NotEnoughFreeSpaceView.swift in Sources */, 9E2F1C8F280EDE09004E65FE /* Drawer.swift in Sources */, 0DB8AA81271DC7520035BC9D /* DesignGuide.swift in Sources */, - F9971A4D27680DC400A2DB75 /* RootStore.swift in Sources */, - 9EAFEB9228081E9400199FC9 /* HomeView.swift in Sources */, - 9E852D6129B098F400CF4AC1 /* RootDebug.swift in Sources */, - F9971A4E27680DC400A2DB75 /* RootView.swift in Sources */, 2EDA07A427EDE2A900D6F09B /* DebugFrame.swift in Sources */, 9E6612332878338C00C75B70 /* LottieAnimation.swift in Sources */, 9E486DF029B9EE84003E6945 /* KeyboardAdaptive.swift in Sources */, - 9EAFEB9128081E9400199FC9 /* HomeStore.swift in Sources */, 0DACFA8127208D940039EEA5 /* UInt+SuperscriptText.swift in Sources */, 0D4E7A0926B364170058B01E /* SecantApp.swift in Sources */, 9E7CB6152869E8C300A02233 /* CircularProgress.swift in Sources */, - 9E9ADA7F2938F5EC0071767B /* RootDestination.swift in Sources */, 34BF09092927C98000222134 /* Memo+toString.swift in Sources */, 346715A528E2027D0035F7C4 /* CheckCircleStore.swift in Sources */, 0D26103C298C3E4800CC9DE9 /* CrashReporterInterface.swift in Sources */, - 9EF8139C27F47AED0075AF48 /* InitializationState.swift in Sources */, 9E486DF329B9EEC4003E6945 /* UIResponder+Current.swift in Sources */, 9E6713FA289BE0E100A6796F /* ClearBackgroundView.swift in Sources */, ); @@ -2454,6 +2348,22 @@ isa = XCSwiftPackageProductDependency; productName = Sandbox; }; + 9EB35D5C2A31C3E100A2149B /* Home */ = { + isa = XCSwiftPackageProductDependency; + productName = Home; + }; + 9EB35D5E2A31C3E600A2149B /* Home */ = { + isa = XCSwiftPackageProductDependency; + productName = Home; + }; + 9EB35D602A31F1D800A2149B /* Root */ = { + isa = XCSwiftPackageProductDependency; + productName = Root; + }; + 9EB35D622A31F1DD00A2149B /* Root */ = { + isa = XCSwiftPackageProductDependency; + productName = Root; + }; 9EE5926C2A2DDF94007147CD /* BalanceBreakdown */ = { isa = XCSwiftPackageProductDependency; productName = BalanceBreakdown; diff --git a/secant/SecantApp.swift b/secant/SecantApp.swift index 7c98f14..639dc88 100644 --- a/secant/SecantApp.swift +++ b/secant/SecantApp.swift @@ -11,9 +11,16 @@ import Generated import ZcashLightClientKit import SDKSynchronizer import Utils +import Root final class AppDelegate: NSObject, UIApplicationDelegate { - var rootStore: RootStore = .placeholder + var rootStore = RootStore( + initialState: .placeholder, + reducer: RootReducer( + tokenName: TargetConstants.tokenName, + zcashNetwork: TargetConstants.zcashNetwork + ).logging() + ) lazy var rootViewStore = ViewStore( rootStore.stateless, removeDuplicates: == @@ -48,8 +55,12 @@ struct SecantApp: App { var body: some Scene { WindowGroup { - RootView(store: appDelegate.rootStore) - .preferredColorScheme(.light) + RootView( + store: appDelegate.rootStore, + tokenName: TargetConstants.tokenName, + networkType: TargetConstants.zcashNetwork.networkType + ) + .preferredColorScheme(.light) } } } diff --git a/secant/Dependencies/CrashReporter/CrashReporterInterface.swift b/secant/_Unmodularized/Dependencies/CrashReporter/CrashReporterInterface.swift similarity index 100% rename from secant/Dependencies/CrashReporter/CrashReporterInterface.swift rename to secant/_Unmodularized/Dependencies/CrashReporter/CrashReporterInterface.swift diff --git a/secant/Dependencies/CrashReporter/CrashReporterLiveKey.swift b/secant/_Unmodularized/Dependencies/CrashReporter/CrashReporterLiveKey.swift similarity index 100% rename from secant/Dependencies/CrashReporter/CrashReporterLiveKey.swift rename to secant/_Unmodularized/Dependencies/CrashReporter/CrashReporterLiveKey.swift diff --git a/secant/Dependencies/CrashReporter/CrashReporterTestKey.swift b/secant/_Unmodularized/Dependencies/CrashReporter/CrashReporterTestKey.swift similarity index 100% rename from secant/Dependencies/CrashReporter/CrashReporterTestKey.swift rename to secant/_Unmodularized/Dependencies/CrashReporter/CrashReporterTestKey.swift diff --git a/secant/UI Components/CheckCircle/CheckCircle.swift b/secant/_Unmodularized/UI Components/CheckCircle/CheckCircle.swift similarity index 100% rename from secant/UI Components/CheckCircle/CheckCircle.swift rename to secant/_Unmodularized/UI Components/CheckCircle/CheckCircle.swift diff --git a/secant/UI Components/CheckCircle/CheckCircleStore.swift b/secant/_Unmodularized/UI Components/CheckCircle/CheckCircleStore.swift similarity index 100% rename from secant/UI Components/CheckCircle/CheckCircleStore.swift rename to secant/_Unmodularized/UI Components/CheckCircle/CheckCircleStore.swift diff --git a/secant/UI Components/CircularProgress/CircularProgress.swift b/secant/_Unmodularized/UI Components/CircularProgress/CircularProgress.swift similarity index 100% rename from secant/UI Components/CircularProgress/CircularProgress.swift rename to secant/_Unmodularized/UI Components/CircularProgress/CircularProgress.swift diff --git a/secant/UI Components/DesignGuide.swift b/secant/_Unmodularized/UI Components/DesignGuide.swift similarity index 99% rename from secant/UI Components/DesignGuide.swift rename to secant/_Unmodularized/UI Components/DesignGuide.swift index a2dd83d..f3ddd82 100644 --- a/secant/UI Components/DesignGuide.swift +++ b/secant/_Unmodularized/UI Components/DesignGuide.swift @@ -7,6 +7,7 @@ import SwiftUI import Generated import UIComponents +import OnboardingFlow struct DesignGuide: View { let columns = [GridItem(.adaptive(minimum: 320, maximum: .infinity))] diff --git a/secant/UI Components/Drawer/Drawer.swift b/secant/_Unmodularized/UI Components/Drawer/Drawer.swift similarity index 100% rename from secant/UI Components/Drawer/Drawer.swift rename to secant/_Unmodularized/UI Components/Drawer/Drawer.swift diff --git a/secant/Utils/ClearBackgroundView.swift b/secant/_Unmodularized/Utils/ClearBackgroundView.swift similarity index 100% rename from secant/Utils/ClearBackgroundView.swift rename to secant/_Unmodularized/Utils/ClearBackgroundView.swift diff --git a/secant/Utils/DebugFrame.swift b/secant/_Unmodularized/Utils/DebugFrame.swift similarity index 100% rename from secant/Utils/DebugFrame.swift rename to secant/_Unmodularized/Utils/DebugFrame.swift diff --git a/secant/Utils/KeyboardAdaptive.swift b/secant/_Unmodularized/Utils/KeyboardAdaptive.swift similarity index 100% rename from secant/Utils/KeyboardAdaptive.swift rename to secant/_Unmodularized/Utils/KeyboardAdaptive.swift diff --git a/secant/Utils/LottieAnimation.swift b/secant/_Unmodularized/Utils/LottieAnimation.swift similarity index 100% rename from secant/Utils/LottieAnimation.swift rename to secant/_Unmodularized/Utils/LottieAnimation.swift diff --git a/secant/Utils/Memo+toString.swift b/secant/_Unmodularized/Utils/Memo+toString.swift similarity index 100% rename from secant/Utils/Memo+toString.swift rename to secant/_Unmodularized/Utils/Memo+toString.swift diff --git a/secant/Utils/Reducers/OnChangeReducer.swift b/secant/_Unmodularized/Utils/Reducers/OnChangeReducer.swift similarity index 100% rename from secant/Utils/Reducers/OnChangeReducer.swift rename to secant/_Unmodularized/Utils/Reducers/OnChangeReducer.swift diff --git a/secant/Utils/UIKit+Extensions.swift b/secant/_Unmodularized/Utils/UIKit+Extensions.swift similarity index 100% rename from secant/Utils/UIKit+Extensions.swift rename to secant/_Unmodularized/Utils/UIKit+Extensions.swift diff --git a/secant/Utils/UIResponder+Current.swift b/secant/_Unmodularized/Utils/UIResponder+Current.swift similarity index 100% rename from secant/Utils/UIResponder+Current.swift rename to secant/_Unmodularized/Utils/UIResponder+Current.swift diff --git a/secant/Utils/UInt+SuperscriptText.swift b/secant/_Unmodularized/Utils/UInt+SuperscriptText.swift similarity index 100% rename from secant/Utils/UInt+SuperscriptText.swift rename to secant/_Unmodularized/Utils/UInt+SuperscriptText.swift diff --git a/secant/Utils/WithStateBinding.swift b/secant/_Unmodularized/Utils/WithStateBinding.swift similarity index 100% rename from secant/Utils/WithStateBinding.swift rename to secant/_Unmodularized/Utils/WithStateBinding.swift diff --git a/secantTests/DeeplinkTests/DeeplinkTests.swift b/secantTests/DeeplinkTests/DeeplinkTests.swift index 925d592..dd81259 100644 --- a/secantTests/DeeplinkTests/DeeplinkTests.swift +++ b/secantTests/DeeplinkTests/DeeplinkTests.swift @@ -11,6 +11,7 @@ import ComposableArchitecture import ZcashLightClientKit import Deeplink import SDKSynchronizer +import Root @testable import secant_testnet @MainActor @@ -21,7 +22,7 @@ class DeeplinkTests: XCTestCase { let store = TestStore( initialState: appState, - reducer: RootReducer() + reducer: RootReducer(tokenName: "ZEC", zcashNetwork: ZcashNetworkBuilder.network(for: .testnet)) ) store.send(.destination(.deeplinkHome)) { state in @@ -36,7 +37,7 @@ class DeeplinkTests: XCTestCase { let store = TestStore( initialState: appState, - reducer: RootReducer() + reducer: RootReducer(tokenName: "ZEC", zcashNetwork: ZcashNetworkBuilder.network(for: .testnet)) ) store.send(.destination(.deeplinkHome)) { state in @@ -51,7 +52,7 @@ class DeeplinkTests: XCTestCase { let store = TestStore( initialState: appState, - reducer: RootReducer() + reducer: RootReducer(tokenName: "ZEC", zcashNetwork: ZcashNetworkBuilder.network(for: .testnet)) ) let amount = Zatoshi(123_000_000) @@ -84,7 +85,7 @@ class DeeplinkTests: XCTestCase { let store = TestStore( initialState: appState, - reducer: RootReducer() + reducer: RootReducer(tokenName: "ZEC", zcashNetwork: ZcashNetworkBuilder.network(for: .testnet)) ) store.dependencies.deeplink = DeeplinkClient( @@ -129,7 +130,7 @@ class DeeplinkTests: XCTestCase { let store = TestStore( initialState: appState, - reducer: RootReducer() + reducer: RootReducer(tokenName: "ZEC", zcashNetwork: ZcashNetworkBuilder.network(for: .testnet)) ) store.dependencies.deeplink = DeeplinkClient( diff --git a/secantTests/HomeTests/HomeTests.swift b/secantTests/HomeTests/HomeTests.swift index 564e279..946d142 100644 --- a/secantTests/HomeTests/HomeTests.swift +++ b/secantTests/HomeTests/HomeTests.swift @@ -10,6 +10,8 @@ import XCTest import ComposableArchitecture import Utils import Generated +import Models +import Home @testable import secant_testnet @testable import ZcashLightClientKit @@ -31,7 +33,7 @@ class HomeTests: XCTestCase { walletConfig: .default, walletEventsState: .emptyPlaceHolder ), - reducer: HomeReducer() + reducer: HomeReducer(networkType: .testnet) ) XCTAssertTrue(store.state.isSyncing) @@ -43,7 +45,7 @@ class HomeTests: XCTestCase { func testOnAppear() throws { let store = TestStore( initialState: .placeholder, - reducer: HomeReducer() + reducer: HomeReducer(networkType: .testnet) ) store.dependencies.mainQueue = .immediate @@ -69,7 +71,7 @@ class HomeTests: XCTestCase { func testOnAppear_notEnoughSpaceOnDisk() throws { let store = TestStore( initialState: .placeholder, - reducer: HomeReducer() + reducer: HomeReducer(networkType: .testnet) ) store.dependencies.diskSpaceChecker = .mockFullDisk @@ -100,7 +102,7 @@ class HomeTests: XCTestCase { let store = TestStore( initialState: .placeholder, - reducer: HomeReducer() + reducer: HomeReducer(networkType: .testnet) ) store.send(.synchronizerStateChanged(state)) { state in diff --git a/secantTests/RecoveryPhraseValidationTests/RecoveryPhraseValidationFlowFeatureFlagTests.swift b/secantTests/RecoveryPhraseValidationTests/RecoveryPhraseValidationFlowFeatureFlagTests.swift index a0fd175..a7c0757 100644 --- a/secantTests/RecoveryPhraseValidationTests/RecoveryPhraseValidationFlowFeatureFlagTests.swift +++ b/secantTests/RecoveryPhraseValidationTests/RecoveryPhraseValidationFlowFeatureFlagTests.swift @@ -14,6 +14,8 @@ import UIComponents import Generated import WalletConfigProvider import RecoveryPhraseDisplay +import Root +import ZcashLightClientKit @testable import secant_testnet // swiftlint:disable:next type_name @@ -31,7 +33,7 @@ class RecoveryPhraseValidationFlowFeatureFlagTests: XCTestCase { func testRecoveryPhraseValidationFlow_SkipPuzzleUserConfirmedBackup() { let store = TestStore( initialState: .placeholder, - reducer: RootReducer() + reducer: RootReducer(tokenName: "ZEC", zcashNetwork: ZcashNetworkBuilder.network(for: .testnet)) ) store.send(.phraseDisplay(.finishedPressed)) { state in @@ -49,7 +51,7 @@ class RecoveryPhraseValidationFlowFeatureFlagTests: XCTestCase { let store = TestStore( initialState: rootState, - reducer: RootReducer() + reducer: RootReducer(tokenName: "ZEC", zcashNetwork: ZcashNetworkBuilder.network(for: .testnet)) ) store.send(.phraseDisplay(.finishedPressed)) @@ -61,7 +63,7 @@ class RecoveryPhraseValidationFlowFeatureFlagTests: XCTestCase { let store = TestStore( initialState: rootState, - reducer: RootReducer() + reducer: RootReducer(tokenName: "ZEC", zcashNetwork: ZcashNetworkBuilder.network(for: .testnet)) ) store.dependencies.mainQueue = .immediate @@ -86,7 +88,7 @@ class RecoveryPhraseValidationFlowFeatureFlagTests: XCTestCase { let store = TestStore( initialState: rootState, - reducer: RootReducer() + reducer: RootReducer(tokenName: "ZEC", zcashNetwork: ZcashNetworkBuilder.network(for: .testnet)) ) let mnemonic = @@ -187,7 +189,7 @@ class RecoveryPhraseValidationFlowFeatureFlagTests: XCTestCase { let store = TestStore( initialState: appState, - reducer: RootReducer() + reducer: RootReducer(tokenName: "ZEC", zcashNetwork: ZcashNetworkBuilder.network(for: .testnet)) ) let testQueue = DispatchQueue.test diff --git a/secantTests/ReviewRequestTests/ReviewRequestTests.swift b/secantTests/ReviewRequestTests/ReviewRequestTests.swift index bb22da5..faf0284 100644 --- a/secantTests/ReviewRequestTests/ReviewRequestTests.swift +++ b/secantTests/ReviewRequestTests/ReviewRequestTests.swift @@ -12,6 +12,8 @@ import Date import AppVersion import UserDefaults import ReviewRequest +import Home +import Models @testable import secant_testnet @MainActor @@ -24,7 +26,7 @@ final class ReviewRequestTests: XCTestCase { let store = TestStore( initialState: .placeholder, - reducer: HomeReducer() + reducer: HomeReducer(networkType: .testnet) ) let now = Date.now @@ -59,7 +61,7 @@ final class ReviewRequestTests: XCTestCase { let store = TestStore( initialState: .placeholder, - reducer: HomeReducer() + reducer: HomeReducer(networkType: .testnet) ) let now = Date.now diff --git a/secantTests/RootTests/AppInitializationTests.swift b/secantTests/RootTests/AppInitializationTests.swift index 40d45b9..f8bb1b8 100644 --- a/secantTests/RootTests/AppInitializationTests.swift +++ b/secantTests/RootTests/AppInitializationTests.swift @@ -13,6 +13,8 @@ import UIComponents import RecoveryPhraseValidationFlow import Generated import RecoveryPhraseDisplay +import Root +import ZcashLightClientKit @testable import secant_testnet class AppInitializationTests: XCTestCase { @@ -93,7 +95,7 @@ class AppInitializationTests: XCTestCase { let store = TestStore( initialState: appState, - reducer: RootReducer() + reducer: RootReducer(tokenName: "ZEC", zcashNetwork: ZcashNetworkBuilder.network(for: .testnet)) ) let testQueue = DispatchQueue.test @@ -150,7 +152,7 @@ class AppInitializationTests: XCTestCase { @MainActor func testDidFinishLaunching_to_KeysMissing() async throws { let store = TestStore( initialState: .placeholder, - reducer: RootReducer() + reducer: RootReducer(tokenName: "ZEC", zcashNetwork: ZcashNetworkBuilder.network(for: .testnet)) ) store.dependencies.databaseFiles = .noOp @@ -184,7 +186,7 @@ class AppInitializationTests: XCTestCase { @MainActor func testDidFinishLaunching_to_Uninitialized() async throws { let store = TestStore( initialState: .placeholder, - reducer: RootReducer() + reducer: RootReducer(tokenName: "ZEC", zcashNetwork: ZcashNetworkBuilder.network(for: .testnet)) ) store.dependencies.databaseFiles = .noOp diff --git a/secantTests/RootTests/DebugTests.swift b/secantTests/RootTests/DebugTests.swift index 78df15f..aac5d02 100644 --- a/secantTests/RootTests/DebugTests.swift +++ b/secantTests/RootTests/DebugTests.swift @@ -6,15 +6,17 @@ // import XCTest -@testable import secant_testnet import ComposableArchitecture +import Root +import ZcashLightClientKit +@testable import secant_testnet @MainActor class DebugTests: XCTestCase { func testRescanBlockchain() async throws { let store = TestStore( initialState: .placeholder, - reducer: RootReducer() + reducer: RootReducer(tokenName: "ZEC", zcashNetwork: ZcashNetworkBuilder.network(for: .testnet)) ) await store.send(.debug(.rescanBlockchain)) { state in @@ -45,7 +47,7 @@ class DebugTests: XCTestCase { let store = TestStore( initialState: mockState, - reducer: RootReducer() + reducer: RootReducer(tokenName: "ZEC", zcashNetwork: ZcashNetworkBuilder.network(for: .testnet)) ) await store.send(.debug(.cancelRescan)) { state in @@ -68,7 +70,7 @@ class DebugTests: XCTestCase { let store = TestStore( initialState: mockState, - reducer: RootReducer() + reducer: RootReducer(tokenName: "ZEC", zcashNetwork: ZcashNetworkBuilder.network(for: .testnet)) ) store.dependencies.mainQueue = .immediate @@ -97,7 +99,7 @@ class DebugTests: XCTestCase { let store = TestStore( initialState: mockState, - reducer: RootReducer() + reducer: RootReducer(tokenName: "ZEC", zcashNetwork: ZcashNetworkBuilder.network(for: .testnet)) ) store.dependencies.mainQueue = .immediate diff --git a/secantTests/RootTests/RootTests.swift b/secantTests/RootTests/RootTests.swift index ba9a2e5..995224d 100644 --- a/secantTests/RootTests/RootTests.swift +++ b/secantTests/RootTests/RootTests.swift @@ -12,6 +12,7 @@ import FileManager import DatabaseFiles import ZcashSDKEnvironment import WalletStorage +import Root @testable import secant_testnet class RootTests: XCTestCase { @@ -20,7 +21,8 @@ class RootTests: XCTestCase { func testWalletInitializationState_Uninitialized() throws { let walletState = RootReducer.walletInitializationState( databaseFiles: .noOp, - walletStorage: .noOp + walletStorage: .noOp, + zcashNetwork: ZcashNetworkBuilder.network(for: .testnet) ) XCTAssertEqual(walletState, .uninitialized) @@ -35,7 +37,8 @@ class RootTests: XCTestCase { let walletState = RootReducer.walletInitializationState( databaseFiles: .live(databaseFiles: DatabaseFiles(fileManager: wfmMock)), - walletStorage: .noOp + walletStorage: .noOp, + zcashNetwork: ZcashNetworkBuilder.network(for: .testnet) ) XCTAssertEqual(walletState, .keysMissing) @@ -50,7 +53,8 @@ class RootTests: XCTestCase { let walletState = RootReducer.walletInitializationState( databaseFiles: .live(databaseFiles: DatabaseFiles(fileManager: wfmMock)), - walletStorage: .noOp + walletStorage: .noOp, + zcashNetwork: ZcashNetworkBuilder.network(for: .testnet) ) XCTAssertEqual(walletState, .uninitialized) @@ -68,7 +72,8 @@ class RootTests: XCTestCase { let walletState = RootReducer.walletInitializationState( databaseFiles: .live(databaseFiles: DatabaseFiles(fileManager: wfmMock)), - walletStorage: walletStorage + walletStorage: walletStorage, + zcashNetwork: ZcashNetworkBuilder.network(for: .testnet) ) XCTAssertEqual(walletState, .filesMissing) @@ -86,7 +91,8 @@ class RootTests: XCTestCase { let walletState = RootReducer.walletInitializationState( databaseFiles: .live(databaseFiles: DatabaseFiles(fileManager: wfmMock)), - walletStorage: walletStorage + walletStorage: walletStorage, + zcashNetwork: ZcashNetworkBuilder.network(for: .testnet) ) XCTAssertEqual(walletState, .initialized) @@ -95,7 +101,7 @@ class RootTests: XCTestCase { func testRespondToWalletInitializationState_Uninitialized() throws { let store = TestStore( initialState: .placeholder, - reducer: RootReducer() + reducer: RootReducer(tokenName: "ZEC", zcashNetwork: ZcashNetworkBuilder.network(for: .testnet)) ) store.dependencies.mainQueue = Self.testScheduler.eraseToAnyScheduler() @@ -113,7 +119,7 @@ class RootTests: XCTestCase { func testRespondToWalletInitializationState_KeysMissing() throws { let store = TestStore( initialState: .placeholder, - reducer: RootReducer() + reducer: RootReducer(tokenName: "ZEC", zcashNetwork: ZcashNetworkBuilder.network(for: .testnet)) ) store.send(.initialization(.respondToWalletInitializationState(.keysMissing))) { state in @@ -128,7 +134,7 @@ class RootTests: XCTestCase { let store = TestStore( initialState: .placeholder, - reducer: RootReducer() + reducer: RootReducer(tokenName: "ZEC", zcashNetwork: ZcashNetworkBuilder.network(for: .testnet)) ) store.dependencies.walletStorage = .noOp @@ -157,7 +163,7 @@ class RootTests: XCTestCase { let store = TestStore( initialState: .placeholder, - reducer: RootReducer() + reducer: RootReducer(tokenName: "ZEC", zcashNetwork: ZcashNetworkBuilder.network(for: .testnet)) ) store.dependencies.walletStorage = .noOp @@ -181,7 +187,7 @@ class RootTests: XCTestCase { func testWalletEventReplyTo_validAddress() throws { let store = TestStore( initialState: .placeholder, - reducer: RootReducer() + reducer: RootReducer(tokenName: "ZEC", zcashNetwork: ZcashNetworkBuilder.network(for: .testnet)) ) let address = "t1gXqfSSQt6WfpwyuCU3Wi7sSVZ66DYQ3Po".redacted diff --git a/secantTests/SnapshotTests/HomeSnapshotTests/HomeSnapshotTests.swift b/secantTests/SnapshotTests/HomeSnapshotTests/HomeSnapshotTests.swift index 8af4738..86b3643 100644 --- a/secantTests/SnapshotTests/HomeSnapshotTests/HomeSnapshotTests.swift +++ b/secantTests/SnapshotTests/HomeSnapshotTests/HomeSnapshotTests.swift @@ -9,6 +9,7 @@ import XCTest import ComposableArchitecture import ZcashLightClientKit import Models +import Home @testable import secant_testnet class HomeSnapshotTests: XCTestCase { @@ -48,7 +49,7 @@ class HomeSnapshotTests: XCTestCase { walletConfig: .default, walletEventsState: .init(walletEvents: IdentifiedArrayOf(uniqueElements: walletEvents)) ), - reducer: HomeReducer() + reducer: HomeReducer(networkType: .testnet) .dependency(\.diskSpaceChecker, .mockEmptyDisk) .dependency(\.sdkSynchronizer, .noOp) .dependency(\.mainQueue, .immediate) @@ -56,6 +57,6 @@ class HomeSnapshotTests: XCTestCase { ) // landing home screen - addAttachments(HomeView(store: store)) + addAttachments(HomeView(store: store, tokenName: "ZEC")) } } diff --git a/secantTests/SnapshotTests/HomeSnapshotTests/NotEnoughFeeSpaceSnapshots.swift b/secantTests/SnapshotTests/HomeSnapshotTests/NotEnoughFeeSpaceSnapshots.swift index 554a4a2..0dbf8f2 100644 --- a/secantTests/SnapshotTests/HomeSnapshotTests/NotEnoughFeeSpaceSnapshots.swift +++ b/secantTests/SnapshotTests/HomeSnapshotTests/NotEnoughFeeSpaceSnapshots.swift @@ -8,9 +8,10 @@ import Foundation import XCTest -@testable import secant_testnet import ComposableArchitecture import ZcashLightClientKit +import Home +@testable import secant_testnet class NotEnoughFeeSpaceSnapshots: XCTestCase { func testNotEnoughFreeSpaceSnapshot() throws { diff --git a/secantTests/SnapshotTests/WalletEventsSnapshotTests/WalletEventsSnapshotTests.swift b/secantTests/SnapshotTests/WalletEventsSnapshotTests/WalletEventsSnapshotTests.swift index 4d7df0b..cb7a237 100644 --- a/secantTests/SnapshotTests/WalletEventsSnapshotTests/WalletEventsSnapshotTests.swift +++ b/secantTests/SnapshotTests/WalletEventsSnapshotTests/WalletEventsSnapshotTests.swift @@ -10,6 +10,7 @@ import ComposableArchitecture import ZcashLightClientKit import Models import WalletEventsFlow +import Home @testable import secant_testnet class WalletEventsSnapshotTests: XCTestCase { @@ -66,7 +67,7 @@ class WalletEventsSnapshotTests: XCTestCase { walletConfig: .default, walletEventsState: .init(walletEvents: IdentifiedArrayOf(uniqueElements: [walletEvent])) ), - reducer: HomeReducer() + reducer: HomeReducer(networkType: .testnet) ) ViewStore(store).send(.walletEvents(.updateDestination(.showWalletEvent(walletEvent)))) @@ -119,7 +120,7 @@ class WalletEventsSnapshotTests: XCTestCase { walletConfig: .default, walletEventsState: .init(walletEvents: IdentifiedArrayOf(uniqueElements: [walletEvent])) ), - reducer: HomeReducer() + reducer: HomeReducer(networkType: .testnet) ) ViewStore(store).send(.walletEvents(.updateDestination(.showWalletEvent(walletEvent)))) @@ -172,7 +173,7 @@ class WalletEventsSnapshotTests: XCTestCase { walletConfig: .default, walletEventsState: .init(walletEvents: IdentifiedArrayOf(uniqueElements: [walletEvent])) ), - reducer: HomeReducer() + reducer: HomeReducer(networkType: .testnet) ) let walletEventsState = WalletEventsFlowReducer.State( @@ -231,7 +232,7 @@ class WalletEventsSnapshotTests: XCTestCase { walletConfig: .default, walletEventsState: .init(walletEvents: IdentifiedArrayOf(uniqueElements: [walletEvent])) ), - reducer: HomeReducer() + reducer: HomeReducer(networkType: .testnet) ) ViewStore(store).send(.walletEvents(.updateDestination(.showWalletEvent(walletEvent)))) diff --git a/secantTests/WalletConfigProviderTests/WalletConfigProviderTests.swift b/secantTests/WalletConfigProviderTests/WalletConfigProviderTests.swift index ec17cd8..c7fcfe4 100644 --- a/secantTests/WalletConfigProviderTests/WalletConfigProviderTests.swift +++ b/secantTests/WalletConfigProviderTests/WalletConfigProviderTests.swift @@ -10,6 +10,8 @@ import XCTest import ComposableArchitecture import WalletConfigProvider import Models +import Root +import ZcashLightClientKit @testable import secant_testnet class WalletConfigProviderTests: XCTestCase { @@ -121,7 +123,7 @@ class WalletConfigProviderTests: XCTestCase { func testPropagationOfFlagUpdate() throws { let store = TestStore( initialState: .placeholder, - reducer: RootReducer() + reducer: RootReducer(tokenName: "ZEC", zcashNetwork: ZcashNetworkBuilder.network(for: .testnet)) ) // Change any of the flags from the default value