[#767] Modularize batch of features Vol IV (#770)

Following features have been modularized:
- Home
- Root
This commit is contained in:
Lukas Korba 2023-06-09 10:29:01 +02:00 committed by GitHub
parent 896f4532a1
commit f1de69f10e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
45 changed files with 405 additions and 306 deletions

View File

@ -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: [

View File

@ -16,14 +16,15 @@ import Scan
import Settings
import SendFlow
typealias HomeStore = Store<HomeReducer.State, HomeReducer.Action>
typealias HomeViewStore = ViewStore<HomeReducer.State, HomeReducer.Action>
public typealias HomeStore = Store<HomeReducer.State, HomeReducer.Action>
public typealias HomeViewStore = ViewStore<HomeReducer.State, HomeReducer.Action>
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<Action>?
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<Action>?
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<Action>)
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<State, Action> {
public init(networkType: NetworkType) {
self.networkType = networkType
}
public var body: some ReducerProtocol<State, Action> {
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)
)
}
}

View File

@ -8,10 +8,16 @@ import WalletEventsFlow
import Settings
import SendFlow
struct HomeView: View {
let store: Store<HomeReducer.State, HomeReducer.Action>
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")
}
}
}

View File

@ -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()
}

View File

@ -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<RootReducer.Action>?
public struct DebugState: Equatable {
public var rescanDialog: ConfirmationDialogState<RootReducer.Action>?
}
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<RootReducer.State, RootReducer.Action> {
public func debugReduce() -> Reduce<RootReducer.State, RootReducer.Action> {
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()
}
}

View File

@ -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<RootReducer.State, RootReducer.Action> {
public func destinationReduce() -> Reduce<RootReducer.State, RootReducer.Action> {
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()
}
}

View File

@ -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<RootReducer.State, RootReducer.Action> {
public func initializationReduce() -> Reduce<RootReducer.State, RootReducer.Action> {
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):

View File

@ -15,32 +15,63 @@ import Foundation
import ExportLogs
import OnboardingFlow
import Sandbox
import Home
typealias RootStore = Store<RootReducer.State, RootReducer.Action>
typealias RootViewStore = ViewStore<RootReducer.State, RootReducer.Action>
public typealias RootStore = Store<RootReducer.State, RootReducer.Action>
public typealias RootViewStore = ViewStore<RootReducer.State, RootReducer.Action>
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<Action>?
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<Action>?
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<Action>)
case binding(BindingAction<RootReducer.State>)
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<State, Action>
var core: some ReducerProtocol<State, Action> {
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<State, Action> {
public var body: some ReducerProtocol<State, Action> {
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()
)
}
}

View File

@ -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
)
}
}

View File

@ -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
}

View File

@ -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()
}

View File

@ -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(

View File

@ -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 = "<group>"; };
341B30BA29B78D1000697081 /* HomeFeatureFlagTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HomeFeatureFlagTests.swift; sourceTree = "<group>"; };
34429C6D28E703CD00F2B929 /* TransactionSendingSnapshotTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TransactionSendingSnapshotTests.swift; sourceTree = "<group>"; };
3448CB3128E47666006ADEDB /* NotEnoughFreeSpaceView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NotEnoughFreeSpaceView.swift; sourceTree = "<group>"; };
3448CB3628E485CB006ADEDB /* NotEnoughFeeSpaceSnapshots.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NotEnoughFeeSpaceSnapshots.swift; sourceTree = "<group>"; };
346715A428E2027D0035F7C4 /* CheckCircleStore.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CheckCircleStore.swift; sourceTree = "<group>"; };
3469F18129ACD70500A07146 /* OnboardingFlowFeatureFlagTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OnboardingFlowFeatureFlagTests.swift; sourceTree = "<group>"; };
@ -283,8 +260,6 @@
6654C7432715A4AC00901167 /* OnboardingStoreTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OnboardingStoreTests.swift; sourceTree = "<group>"; };
9E01F8272833CDA0000EFC57 /* ScanTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ScanTests.swift; sourceTree = "<group>"; };
9E02B56B27FED475005B809B /* DatabaseFilesTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DatabaseFilesTests.swift; sourceTree = "<group>"; };
9E0F5740297E7F1C005304FA /* TCALogging.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TCALogging.swift; sourceTree = "<group>"; };
9E0F5742297EB96C005304FA /* TCALoggerReducer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TCALoggerReducer.swift; sourceTree = "<group>"; };
9E0F574A2980260D005304FA /* LoggerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LoggerTests.swift; sourceTree = "<group>"; };
9E207C352966EC77003E2C9B /* AddressDetailsSnapshotTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AddressDetailsSnapshotTests.swift; sourceTree = "<group>"; };
9E207C382966EF87003E2C9B /* AddressDetailsTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AddressDetailsTests.swift; sourceTree = "<group>"; };
@ -300,7 +275,6 @@
9E5BF63E2819542C00BA3F17 /* WalletEventsTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WalletEventsTests.swift; sourceTree = "<group>"; };
9E5BF643281FEC9900BA3F17 /* SendTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SendTests.swift; sourceTree = "<group>"; };
9E612C7829913F3600D09B09 /* SensitiveDataTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SensitiveDataTests.swift; sourceTree = "<group>"; };
9E66122B2877188700C75B70 /* SyncStatusSnapshot.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SyncStatusSnapshot.swift; sourceTree = "<group>"; };
9E6612322878338C00C75B70 /* LottieAnimation.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LottieAnimation.swift; sourceTree = "<group>"; };
9E6612352878345000C75B70 /* endlessCircleProgress.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = endlessCircleProgress.json; sourceTree = "<group>"; };
9E66129D288938A300C75B70 /* SettingsTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingsTests.swift; sourceTree = "<group>"; };
@ -313,14 +287,11 @@
9E7CB6232874246800A02233 /* ProfileTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProfileTests.swift; sourceTree = "<group>"; };
9E7CB6262874269F00A02233 /* ProfileSnapshotTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProfileSnapshotTests.swift; sourceTree = "<group>"; };
9E852D5B29AF8EB200CF4AC1 /* RecoveryPhraseValidationFlowFeatureFlagTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RecoveryPhraseValidationFlowFeatureFlagTests.swift; sourceTree = "<group>"; };
9E852D6029B098F400CF4AC1 /* RootDebug.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RootDebug.swift; sourceTree = "<group>"; };
9E852D6429B0A86300CF4AC1 /* DebugTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DebugTests.swift; sourceTree = "<group>"; };
9E90751D2A269BE300269308 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
9E92AF0728530EBF007367AD /* View+UIImage.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "View+UIImage.swift"; sourceTree = "<group>"; };
9E94C61F28AA7DEE008256E9 /* BalanceBreakdownTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BalanceBreakdownTests.swift; sourceTree = "<group>"; };
9E94C62228AA7EE0008256E9 /* BalanceBreakdownSnapshotTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BalanceBreakdownSnapshotTests.swift; sourceTree = "<group>"; };
9E9ADA7C2938F4C00071767B /* RootInitialization.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RootInitialization.swift; sourceTree = "<group>"; };
9E9ADA7E2938F5EC0071767B /* RootDestination.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RootDestination.swift; sourceTree = "<group>"; };
9E9CEA3D29D47BE000599DF5 /* OnChangeReducer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OnChangeReducer.swift; sourceTree = "<group>"; };
9E9ECC8C28589E150099D5A2 /* HomeSnapshotTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HomeSnapshotTests.swift; sourceTree = "<group>"; };
9E9ECC8E28589E150099D5A2 /* WelcomeSnapshotTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WelcomeSnapshotTests.swift; sourceTree = "<group>"; };
@ -337,12 +308,6 @@
9EDDEAA12829610D00B4100C /* TransactionAddressInputTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TransactionAddressInputTests.swift; sourceTree = "<group>"; };
9EF8135A27ECC25E0075AF48 /* WalletStorageTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WalletStorageTests.swift; sourceTree = "<group>"; };
9EF8135B27ECC25E0075AF48 /* UserPreferencesStorageTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UserPreferencesStorageTests.swift; sourceTree = "<group>"; };
9EF8135F27F043CC0075AF48 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
9EF8139B27F47AED0075AF48 /* InitializationState.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InitializationState.swift; sourceTree = "<group>"; };
F93874ED273C4DE200F0E875 /* HomeStore.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HomeStore.swift; sourceTree = "<group>"; };
F93874EF273C4DE200F0E875 /* HomeView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HomeView.swift; sourceTree = "<group>"; };
F9971A4A27680DC400A2DB75 /* RootStore.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RootStore.swift; sourceTree = "<group>"; };
F9971A4C27680DC400A2DB75 /* RootView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RootView.swift; sourceTree = "<group>"; };
F9EEB8152742C2210032EEB8 /* WithStateBinding.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WithStateBinding.swift; sourceTree = "<group>"; };
/* 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 = "<group>";
};
0DA13CA326C1960A00E3B610 /* Models */ = {
isa = PBXGroup;
children = (
9EF8135F27F043CC0075AF48 /* AppDelegate.swift */,
9EF8139B27F47AED0075AF48 /* InitializationState.swift */,
9E66122B2877188700C75B70 /* SyncStatusSnapshot.swift */,
);
path = Models;
sourceTree = "<group>";
};
0DFE93DD272C6D4B000FCCA5 /* BackupFlowTests */ = {
isa = PBXGroup;
children = (
@ -604,14 +559,6 @@
name = Frameworks;
sourceTree = "<group>";
};
3448CB3028E4764E006ADEDB /* NotEnoughFreeSpace */ = {
isa = PBXGroup;
children = (
3448CB3128E47666006ADEDB /* NotEnoughFreeSpaceView.swift */,
);
path = NotEnoughFreeSpace;
sourceTree = "<group>";
};
346715A628E20FB30035F7C4 /* SendSnapshotTests */ = {
isa = PBXGroup;
children = (
@ -637,16 +584,6 @@
path = WalletConfigProviderTests;
sourceTree = "<group>";
};
6654C73B2715A3F000901167 /* Features */ = {
isa = PBXGroup;
children = (
F93874EC273C4DE200F0E875 /* Home */,
3448CB3028E4764E006ADEDB /* NotEnoughFreeSpace */,
F9971A4927680DC400A2DB75 /* Root */,
);
path = Features;
sourceTree = "<group>";
};
6654C7422715A48E00901167 /* OnboardingTests */ = {
isa = PBXGroup;
children = (
@ -664,15 +601,6 @@
path = ScanTests;
sourceTree = "<group>";
};
9E0F573F297E7F00005304FA /* Logging */ = {
isa = PBXGroup;
children = (
9E0F5740297E7F1C005304FA /* TCALogging.swift */,
9E0F5742297EB96C005304FA /* TCALoggerReducer.swift */,
);
path = Logging;
sourceTree = "<group>";
};
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 = "<group>";
@ -972,6 +899,16 @@
path = RootTests;
sourceTree = "<group>";
};
9EB35D642A31F65C00A2149B /* _Unmodularized */ = {
isa = PBXGroup;
children = (
9E7FE0BB282D1DC200C374E8 /* Utils */,
9E7FE0BD282D1DE100C374E8 /* Dependencies */,
9E7FE0BE282D1DFE00C374E8 /* UI Components */,
);
path = _Unmodularized;
sourceTree = "<group>";
};
9EF8135927ECC25E0075AF48 /* UtilTests */ = {
isa = PBXGroup;
children = (
@ -986,27 +923,6 @@
path = UtilTests;
sourceTree = "<group>";
};
F93874EC273C4DE200F0E875 /* Home */ = {
isa = PBXGroup;
children = (
F93874ED273C4DE200F0E875 /* HomeStore.swift */,
F93874EF273C4DE200F0E875 /* HomeView.swift */,
);
path = Home;
sourceTree = "<group>";
};
F9971A4927680DC400A2DB75 /* Root */ = {
isa = PBXGroup;
children = (
F9971A4A27680DC400A2DB75 /* RootStore.swift */,
F9971A4C27680DC400A2DB75 /* RootView.swift */,
9E9ADA7E2938F5EC0071767B /* RootDestination.swift */,
9E9ADA7C2938F4C00071767B /* RootInitialization.swift */,
9E852D6029B098F400CF4AC1 /* RootDebug.swift */,
);
path = Root;
sourceTree = "<group>";
};
/* 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;

View File

@ -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)
}
}
}

View File

@ -7,6 +7,7 @@
import SwiftUI
import Generated
import UIComponents
import OnboardingFlow
struct DesignGuide: View {
let columns = [GridItem(.adaptive(minimum: 320, maximum: .infinity))]

View File

@ -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(

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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"))
}
}

View File

@ -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 {

View File

@ -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))))

View File

@ -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