secant-ios-wallet/secant/Features/App/App.swift

243 lines
8.8 KiB
Swift
Raw Normal View History

import ComposableArchitecture
struct AppState: Equatable {
Issue #44: Recovery Phrase Validation flow + tests Rename struct to RecoveryPhraseValidationState. Add docs WordGrid + tests Make Word Groups Droppable and Blue word chips draggable cleanup Rename Stores and adopt aliases and default pattern for reducers Fix drop not working FIX: apply background to header. Spacing Fix compilation errors. Add validation demo to AppView Fix: the empty chips are rendered once, because they are not uniquely identifiable Add the Validation screen to the App Home make mutating functions static fix project warnings Fix Tests Fixed .complete test refactoring the Enum. first step Move given() to RecoveryPhraseValidationState and fix tests Add canary test for computed property of State Move RecoveryPhraseValidationStep to a nested type of RecoveryPhraseValidationState rename RecoveryPhraseValidationState.RecoveryPhraseValidationStep to RecoveryPhraseValidationState.Step Move static functions from RecoveryPhraseValidationStep to RecoveryPhraseValidationState Move creational factory methods together to the same extension Remove unused functions remove associated values from Step enum Fix: Avoid Drop being disable between chips 0.0.1-10 add navigation bar to phrase validation demo Reduce spacing between groups. Code cleanup Remove RecoveryPhraseValidationStep.swift Move remaining code to proper places PR Fixes. Move .initial factory method to test target. Rename given() to apply(chip:group:) and make it a member function Cleanup. Remove .validate, .invalid and .valid states. Figure word chips out of the state. Fix randomIndices() Tie view's title to state Connect Header to State BlueChip is now ColoredChip. Success Screen fix project Connect Success Screen to successful validation Add Red color to backgrounds Validation Failed Screen Connect SuccessValidation Screen to home hide back button on Success view Connect Phrase Display to validation 0.0.1-11 Fix word grid background colors View Modifier to add scrollview when the content is being scaled up by DynamicType Adjust UI spacing and padding to designs Add Placeholder states for SwiftUI Previews Flatten EnumeratedChip Hierarchy Flatten EnumeratedChip view hierarchy Fix: LazyVGrid can't take GeometryReader on its items' bodies Fix: Colored Chip does not adjust Fix: Vertical separation between wordgroups is too tall. Fix: Accesibility fixes for Validation Failed screen Rename ValidationFailedView Accessibility Pass on Validation success screen FIX: Colored chips too big when scaled up Fix: ValidationFailedScreen does not scroll well when scaled up Fix Empty chip shadow color for dark color scheme Fix: chip grid background does not bleed out to bottom of the screen build 12 Fix: pre success/failure screen step shrinks the screen because word grid is missing Resolved PR comments Fixes to resolve PR conversations Fixes to resolve PR conversations Fix PhraseChip preview Make ScrollableWhenScaledUp modifier fileprivate Remove comments and clean up code Fix Swiftlint issues Renamed RecoveryPhraseStepFulfillment to ValidationWord Rename pickWordsFromMissingIndices PR fixes PR suggestions PR suggestions Move words(fromMissingIndices:size) to RecoveryPhrase Make ScrollableWhenScaled struct fileprivate PR Suggestions Part two PR Suggestion changes remove unused PR suggestions suggested rename PR suggestions remove apply(chip:into) move that to Reducer Formatting changes more formatting changes Fix: iPhone 13 Pro Max displays 4 columns instead of three Fix: Recovery Phrase puzzle shows incorrect number of columns and margin alignment on bigger devices Add test to catch state not changing as intended Phrase validation reducer refactor + tests make step computed property a bool make isComplete a single line PR Suggestions Rename ValidationSuccededView.swift Fix Bug: valid phrase should contemplate that the phrase is complete first PR Suggestion refactor and add Unit Tests for resultingPhrase, isComplete, isValid
2021-12-13 12:50:04 -08:00
enum Route: Equatable {
case welcome
case startup
case onboarding
case home
Issue #44: Recovery Phrase Validation flow + tests Rename struct to RecoveryPhraseValidationState. Add docs WordGrid + tests Make Word Groups Droppable and Blue word chips draggable cleanup Rename Stores and adopt aliases and default pattern for reducers Fix drop not working FIX: apply background to header. Spacing Fix compilation errors. Add validation demo to AppView Fix: the empty chips are rendered once, because they are not uniquely identifiable Add the Validation screen to the App Home make mutating functions static fix project warnings Fix Tests Fixed .complete test refactoring the Enum. first step Move given() to RecoveryPhraseValidationState and fix tests Add canary test for computed property of State Move RecoveryPhraseValidationStep to a nested type of RecoveryPhraseValidationState rename RecoveryPhraseValidationState.RecoveryPhraseValidationStep to RecoveryPhraseValidationState.Step Move static functions from RecoveryPhraseValidationStep to RecoveryPhraseValidationState Move creational factory methods together to the same extension Remove unused functions remove associated values from Step enum Fix: Avoid Drop being disable between chips 0.0.1-10 add navigation bar to phrase validation demo Reduce spacing between groups. Code cleanup Remove RecoveryPhraseValidationStep.swift Move remaining code to proper places PR Fixes. Move .initial factory method to test target. Rename given() to apply(chip:group:) and make it a member function Cleanup. Remove .validate, .invalid and .valid states. Figure word chips out of the state. Fix randomIndices() Tie view's title to state Connect Header to State BlueChip is now ColoredChip. Success Screen fix project Connect Success Screen to successful validation Add Red color to backgrounds Validation Failed Screen Connect SuccessValidation Screen to home hide back button on Success view Connect Phrase Display to validation 0.0.1-11 Fix word grid background colors View Modifier to add scrollview when the content is being scaled up by DynamicType Adjust UI spacing and padding to designs Add Placeholder states for SwiftUI Previews Flatten EnumeratedChip Hierarchy Flatten EnumeratedChip view hierarchy Fix: LazyVGrid can't take GeometryReader on its items' bodies Fix: Colored Chip does not adjust Fix: Vertical separation between wordgroups is too tall. Fix: Accesibility fixes for Validation Failed screen Rename ValidationFailedView Accessibility Pass on Validation success screen FIX: Colored chips too big when scaled up Fix: ValidationFailedScreen does not scroll well when scaled up Fix Empty chip shadow color for dark color scheme Fix: chip grid background does not bleed out to bottom of the screen build 12 Fix: pre success/failure screen step shrinks the screen because word grid is missing Resolved PR comments Fixes to resolve PR conversations Fixes to resolve PR conversations Fix PhraseChip preview Make ScrollableWhenScaledUp modifier fileprivate Remove comments and clean up code Fix Swiftlint issues Renamed RecoveryPhraseStepFulfillment to ValidationWord Rename pickWordsFromMissingIndices PR fixes PR suggestions PR suggestions Move words(fromMissingIndices:size) to RecoveryPhrase Make ScrollableWhenScaled struct fileprivate PR Suggestions Part two PR Suggestion changes remove unused PR suggestions suggested rename PR suggestions remove apply(chip:into) move that to Reducer Formatting changes more formatting changes Fix: iPhone 13 Pro Max displays 4 columns instead of three Fix: Recovery Phrase puzzle shows incorrect number of columns and margin alignment on bigger devices Add test to catch state not changing as intended Phrase validation reducer refactor + tests make step computed property a bool make isComplete a single line PR Suggestions Rename ValidationSuccededView.swift Fix Bug: valid phrase should contemplate that the phrase is complete first PR Suggestion refactor and add Unit Tests for resultingPhrase, isComplete, isValid
2021-12-13 12:50:04 -08:00
case phraseValidation
case phraseDisplay
}
Issue #44: Recovery Phrase Validation flow + tests Rename struct to RecoveryPhraseValidationState. Add docs WordGrid + tests Make Word Groups Droppable and Blue word chips draggable cleanup Rename Stores and adopt aliases and default pattern for reducers Fix drop not working FIX: apply background to header. Spacing Fix compilation errors. Add validation demo to AppView Fix: the empty chips are rendered once, because they are not uniquely identifiable Add the Validation screen to the App Home make mutating functions static fix project warnings Fix Tests Fixed .complete test refactoring the Enum. first step Move given() to RecoveryPhraseValidationState and fix tests Add canary test for computed property of State Move RecoveryPhraseValidationStep to a nested type of RecoveryPhraseValidationState rename RecoveryPhraseValidationState.RecoveryPhraseValidationStep to RecoveryPhraseValidationState.Step Move static functions from RecoveryPhraseValidationStep to RecoveryPhraseValidationState Move creational factory methods together to the same extension Remove unused functions remove associated values from Step enum Fix: Avoid Drop being disable between chips 0.0.1-10 add navigation bar to phrase validation demo Reduce spacing between groups. Code cleanup Remove RecoveryPhraseValidationStep.swift Move remaining code to proper places PR Fixes. Move .initial factory method to test target. Rename given() to apply(chip:group:) and make it a member function Cleanup. Remove .validate, .invalid and .valid states. Figure word chips out of the state. Fix randomIndices() Tie view's title to state Connect Header to State BlueChip is now ColoredChip. Success Screen fix project Connect Success Screen to successful validation Add Red color to backgrounds Validation Failed Screen Connect SuccessValidation Screen to home hide back button on Success view Connect Phrase Display to validation 0.0.1-11 Fix word grid background colors View Modifier to add scrollview when the content is being scaled up by DynamicType Adjust UI spacing and padding to designs Add Placeholder states for SwiftUI Previews Flatten EnumeratedChip Hierarchy Flatten EnumeratedChip view hierarchy Fix: LazyVGrid can't take GeometryReader on its items' bodies Fix: Colored Chip does not adjust Fix: Vertical separation between wordgroups is too tall. Fix: Accesibility fixes for Validation Failed screen Rename ValidationFailedView Accessibility Pass on Validation success screen FIX: Colored chips too big when scaled up Fix: ValidationFailedScreen does not scroll well when scaled up Fix Empty chip shadow color for dark color scheme Fix: chip grid background does not bleed out to bottom of the screen build 12 Fix: pre success/failure screen step shrinks the screen because word grid is missing Resolved PR comments Fixes to resolve PR conversations Fixes to resolve PR conversations Fix PhraseChip preview Make ScrollableWhenScaledUp modifier fileprivate Remove comments and clean up code Fix Swiftlint issues Renamed RecoveryPhraseStepFulfillment to ValidationWord Rename pickWordsFromMissingIndices PR fixes PR suggestions PR suggestions Move words(fromMissingIndices:size) to RecoveryPhrase Make ScrollableWhenScaled struct fileprivate PR Suggestions Part two PR Suggestion changes remove unused PR suggestions suggested rename PR suggestions remove apply(chip:into) move that to Reducer Formatting changes more formatting changes Fix: iPhone 13 Pro Max displays 4 columns instead of three Fix: Recovery Phrase puzzle shows incorrect number of columns and margin alignment on bigger devices Add test to catch state not changing as intended Phrase validation reducer refactor + tests make step computed property a bool make isComplete a single line PR Suggestions Rename ValidationSuccededView.swift Fix Bug: valid phrase should contemplate that the phrase is complete first PR Suggestion refactor and add Unit Tests for resultingPhrase, isComplete, isValid
2021-12-13 12:50:04 -08:00
var homeState: HomeState
var onboardingState: OnboardingState
Issue #44: Recovery Phrase Validation flow + tests Rename struct to RecoveryPhraseValidationState. Add docs WordGrid + tests Make Word Groups Droppable and Blue word chips draggable cleanup Rename Stores and adopt aliases and default pattern for reducers Fix drop not working FIX: apply background to header. Spacing Fix compilation errors. Add validation demo to AppView Fix: the empty chips are rendered once, because they are not uniquely identifiable Add the Validation screen to the App Home make mutating functions static fix project warnings Fix Tests Fixed .complete test refactoring the Enum. first step Move given() to RecoveryPhraseValidationState and fix tests Add canary test for computed property of State Move RecoveryPhraseValidationStep to a nested type of RecoveryPhraseValidationState rename RecoveryPhraseValidationState.RecoveryPhraseValidationStep to RecoveryPhraseValidationState.Step Move static functions from RecoveryPhraseValidationStep to RecoveryPhraseValidationState Move creational factory methods together to the same extension Remove unused functions remove associated values from Step enum Fix: Avoid Drop being disable between chips 0.0.1-10 add navigation bar to phrase validation demo Reduce spacing between groups. Code cleanup Remove RecoveryPhraseValidationStep.swift Move remaining code to proper places PR Fixes. Move .initial factory method to test target. Rename given() to apply(chip:group:) and make it a member function Cleanup. Remove .validate, .invalid and .valid states. Figure word chips out of the state. Fix randomIndices() Tie view's title to state Connect Header to State BlueChip is now ColoredChip. Success Screen fix project Connect Success Screen to successful validation Add Red color to backgrounds Validation Failed Screen Connect SuccessValidation Screen to home hide back button on Success view Connect Phrase Display to validation 0.0.1-11 Fix word grid background colors View Modifier to add scrollview when the content is being scaled up by DynamicType Adjust UI spacing and padding to designs Add Placeholder states for SwiftUI Previews Flatten EnumeratedChip Hierarchy Flatten EnumeratedChip view hierarchy Fix: LazyVGrid can't take GeometryReader on its items' bodies Fix: Colored Chip does not adjust Fix: Vertical separation between wordgroups is too tall. Fix: Accesibility fixes for Validation Failed screen Rename ValidationFailedView Accessibility Pass on Validation success screen FIX: Colored chips too big when scaled up Fix: ValidationFailedScreen does not scroll well when scaled up Fix Empty chip shadow color for dark color scheme Fix: chip grid background does not bleed out to bottom of the screen build 12 Fix: pre success/failure screen step shrinks the screen because word grid is missing Resolved PR comments Fixes to resolve PR conversations Fixes to resolve PR conversations Fix PhraseChip preview Make ScrollableWhenScaledUp modifier fileprivate Remove comments and clean up code Fix Swiftlint issues Renamed RecoveryPhraseStepFulfillment to ValidationWord Rename pickWordsFromMissingIndices PR fixes PR suggestions PR suggestions Move words(fromMissingIndices:size) to RecoveryPhrase Make ScrollableWhenScaled struct fileprivate PR Suggestions Part two PR Suggestion changes remove unused PR suggestions suggested rename PR suggestions remove apply(chip:into) move that to Reducer Formatting changes more formatting changes Fix: iPhone 13 Pro Max displays 4 columns instead of three Fix: Recovery Phrase puzzle shows incorrect number of columns and margin alignment on bigger devices Add test to catch state not changing as intended Phrase validation reducer refactor + tests make step computed property a bool make isComplete a single line PR Suggestions Rename ValidationSuccededView.swift Fix Bug: valid phrase should contemplate that the phrase is complete first PR Suggestion refactor and add Unit Tests for resultingPhrase, isComplete, isValid
2021-12-13 12:50:04 -08:00
var phraseValidationState: RecoveryPhraseValidationState
var phraseDisplayState: RecoveryPhraseDisplayState
var route: Route = .welcome
var storedWallet: StoredWallet?
var appInitializationState: InitializationState = .uninitialized
}
enum AppAction: Equatable {
case appDelegate(AppDelegateAction)
case checkWalletInitialization
case createNewWallet
case home(HomeAction)
case initializeApp
case onboarding(OnboardingAction)
Issue #44: Recovery Phrase Validation flow + tests Rename struct to RecoveryPhraseValidationState. Add docs WordGrid + tests Make Word Groups Droppable and Blue word chips draggable cleanup Rename Stores and adopt aliases and default pattern for reducers Fix drop not working FIX: apply background to header. Spacing Fix compilation errors. Add validation demo to AppView Fix: the empty chips are rendered once, because they are not uniquely identifiable Add the Validation screen to the App Home make mutating functions static fix project warnings Fix Tests Fixed .complete test refactoring the Enum. first step Move given() to RecoveryPhraseValidationState and fix tests Add canary test for computed property of State Move RecoveryPhraseValidationStep to a nested type of RecoveryPhraseValidationState rename RecoveryPhraseValidationState.RecoveryPhraseValidationStep to RecoveryPhraseValidationState.Step Move static functions from RecoveryPhraseValidationStep to RecoveryPhraseValidationState Move creational factory methods together to the same extension Remove unused functions remove associated values from Step enum Fix: Avoid Drop being disable between chips 0.0.1-10 add navigation bar to phrase validation demo Reduce spacing between groups. Code cleanup Remove RecoveryPhraseValidationStep.swift Move remaining code to proper places PR Fixes. Move .initial factory method to test target. Rename given() to apply(chip:group:) and make it a member function Cleanup. Remove .validate, .invalid and .valid states. Figure word chips out of the state. Fix randomIndices() Tie view's title to state Connect Header to State BlueChip is now ColoredChip. Success Screen fix project Connect Success Screen to successful validation Add Red color to backgrounds Validation Failed Screen Connect SuccessValidation Screen to home hide back button on Success view Connect Phrase Display to validation 0.0.1-11 Fix word grid background colors View Modifier to add scrollview when the content is being scaled up by DynamicType Adjust UI spacing and padding to designs Add Placeholder states for SwiftUI Previews Flatten EnumeratedChip Hierarchy Flatten EnumeratedChip view hierarchy Fix: LazyVGrid can't take GeometryReader on its items' bodies Fix: Colored Chip does not adjust Fix: Vertical separation between wordgroups is too tall. Fix: Accesibility fixes for Validation Failed screen Rename ValidationFailedView Accessibility Pass on Validation success screen FIX: Colored chips too big when scaled up Fix: ValidationFailedScreen does not scroll well when scaled up Fix Empty chip shadow color for dark color scheme Fix: chip grid background does not bleed out to bottom of the screen build 12 Fix: pre success/failure screen step shrinks the screen because word grid is missing Resolved PR comments Fixes to resolve PR conversations Fixes to resolve PR conversations Fix PhraseChip preview Make ScrollableWhenScaledUp modifier fileprivate Remove comments and clean up code Fix Swiftlint issues Renamed RecoveryPhraseStepFulfillment to ValidationWord Rename pickWordsFromMissingIndices PR fixes PR suggestions PR suggestions Move words(fromMissingIndices:size) to RecoveryPhrase Make ScrollableWhenScaled struct fileprivate PR Suggestions Part two PR Suggestion changes remove unused PR suggestions suggested rename PR suggestions remove apply(chip:into) move that to Reducer Formatting changes more formatting changes Fix: iPhone 13 Pro Max displays 4 columns instead of three Fix: Recovery Phrase puzzle shows incorrect number of columns and margin alignment on bigger devices Add test to catch state not changing as intended Phrase validation reducer refactor + tests make step computed property a bool make isComplete a single line PR Suggestions Rename ValidationSuccededView.swift Fix Bug: valid phrase should contemplate that the phrase is complete first PR Suggestion refactor and add Unit Tests for resultingPhrase, isComplete, isValid
2021-12-13 12:50:04 -08:00
case phraseDisplay(RecoveryPhraseDisplayAction)
case phraseValidation(RecoveryPhraseValidationAction)
case updateRoute(AppState.Route)
}
struct AppEnvironment {
let scheduler: AnySchedulerOf<DispatchQueue>
let mnemonicSeedPhraseProvider: MnemonicSeedPhraseProvider
let walletStorage: WalletStorageInteractor
}
extension AppEnvironment {
static let live = AppEnvironment(
scheduler: DispatchQueue.main.eraseToAnyScheduler(),
mnemonicSeedPhraseProvider: .live,
walletStorage: .live(walletStorage: WalletStorage())
)
static let mock = AppEnvironment(
scheduler: DispatchQueue.main.eraseToAnyScheduler(),
mnemonicSeedPhraseProvider: .mock,
walletStorage: .live(walletStorage: WalletStorage())
)
}
// MARK: - AppReducer
typealias AppReducer = Reducer<AppState, AppAction, AppEnvironment>
extension AppReducer {
static let `default` = AppReducer.combine(
[
appReducer,
routeReducer,
homeReducer,
Issue #44: Recovery Phrase Validation flow + tests Rename struct to RecoveryPhraseValidationState. Add docs WordGrid + tests Make Word Groups Droppable and Blue word chips draggable cleanup Rename Stores and adopt aliases and default pattern for reducers Fix drop not working FIX: apply background to header. Spacing Fix compilation errors. Add validation demo to AppView Fix: the empty chips are rendered once, because they are not uniquely identifiable Add the Validation screen to the App Home make mutating functions static fix project warnings Fix Tests Fixed .complete test refactoring the Enum. first step Move given() to RecoveryPhraseValidationState and fix tests Add canary test for computed property of State Move RecoveryPhraseValidationStep to a nested type of RecoveryPhraseValidationState rename RecoveryPhraseValidationState.RecoveryPhraseValidationStep to RecoveryPhraseValidationState.Step Move static functions from RecoveryPhraseValidationStep to RecoveryPhraseValidationState Move creational factory methods together to the same extension Remove unused functions remove associated values from Step enum Fix: Avoid Drop being disable between chips 0.0.1-10 add navigation bar to phrase validation demo Reduce spacing between groups. Code cleanup Remove RecoveryPhraseValidationStep.swift Move remaining code to proper places PR Fixes. Move .initial factory method to test target. Rename given() to apply(chip:group:) and make it a member function Cleanup. Remove .validate, .invalid and .valid states. Figure word chips out of the state. Fix randomIndices() Tie view's title to state Connect Header to State BlueChip is now ColoredChip. Success Screen fix project Connect Success Screen to successful validation Add Red color to backgrounds Validation Failed Screen Connect SuccessValidation Screen to home hide back button on Success view Connect Phrase Display to validation 0.0.1-11 Fix word grid background colors View Modifier to add scrollview when the content is being scaled up by DynamicType Adjust UI spacing and padding to designs Add Placeholder states for SwiftUI Previews Flatten EnumeratedChip Hierarchy Flatten EnumeratedChip view hierarchy Fix: LazyVGrid can't take GeometryReader on its items' bodies Fix: Colored Chip does not adjust Fix: Vertical separation between wordgroups is too tall. Fix: Accesibility fixes for Validation Failed screen Rename ValidationFailedView Accessibility Pass on Validation success screen FIX: Colored chips too big when scaled up Fix: ValidationFailedScreen does not scroll well when scaled up Fix Empty chip shadow color for dark color scheme Fix: chip grid background does not bleed out to bottom of the screen build 12 Fix: pre success/failure screen step shrinks the screen because word grid is missing Resolved PR comments Fixes to resolve PR conversations Fixes to resolve PR conversations Fix PhraseChip preview Make ScrollableWhenScaledUp modifier fileprivate Remove comments and clean up code Fix Swiftlint issues Renamed RecoveryPhraseStepFulfillment to ValidationWord Rename pickWordsFromMissingIndices PR fixes PR suggestions PR suggestions Move words(fromMissingIndices:size) to RecoveryPhrase Make ScrollableWhenScaled struct fileprivate PR Suggestions Part two PR Suggestion changes remove unused PR suggestions suggested rename PR suggestions remove apply(chip:into) move that to Reducer Formatting changes more formatting changes Fix: iPhone 13 Pro Max displays 4 columns instead of three Fix: Recovery Phrase puzzle shows incorrect number of columns and margin alignment on bigger devices Add test to catch state not changing as intended Phrase validation reducer refactor + tests make step computed property a bool make isComplete a single line PR Suggestions Rename ValidationSuccededView.swift Fix Bug: valid phrase should contemplate that the phrase is complete first PR Suggestion refactor and add Unit Tests for resultingPhrase, isComplete, isValid
2021-12-13 12:50:04 -08:00
onboardingReducer,
phraseValidationReducer,
phraseDisplayReducer
]
)
.debug()
private static let appReducer = AppReducer { state, action, environment in
switch action {
case .createNewWallet:
let randomPhraseWords: [String]
do {
let randomPhrase = try environment.mnemonicSeedPhraseProvider.randomMnemonic()
randomPhraseWords = try environment.mnemonicSeedPhraseProvider.asWords(randomPhrase)
// TODO: - Get birthday from the integrated SDK, issue 228 (https://github.com/zcash/secant-ios-wallet/issues/228)
let birthday = BlockHeight(12345678)
try environment.walletStorage.importWallet(randomPhrase, birthday, .english, false)
} catch {
// TODO: - merge with issue 201 (https://github.com/zcash/secant-ios-wallet/issues/201) and its Error States
return .none
}
let recoveryPhrase = RecoveryPhrase(words: randomPhraseWords)
state.phraseDisplayState.phrase = recoveryPhrase
state.phraseValidationState = RecoveryPhraseValidationState.random(phrase: recoveryPhrase)
return Effect(value: .phraseValidation(.displayBackedUpPhrase))
/// Checking presense of stored wallet in the keychain and presense of database files in documents directory.
case .checkWalletInitialization:
// TODO: Create a dependency to handle database files for the SDK, issue #220 (https://github.com/zcash/secant-ios-wallet/issues/220)
let fileManager = FileManager()
do {
// TODO: use database URL from the same issue #220
let documentsURL = try fileManager.url(for: .documentDirectory, in: .userDomainMask, appropriateFor: nil, create: true)
let dataDatabaseURL = documentsURL.appendingPathComponent("ZcashSDK.defaultDataDbName", isDirectory: false)
let attributes = try fileManager.attributesOfItem(atPath: dataDatabaseURL.path)
let databaseFilesPresent = attributes.isEmpty
let keysPresent = try environment.walletStorage.areKeysPresent()
switch (keysPresent, databaseFilesPresent) {
case (false, false):
state.appInitializationState = .uninitialized
case (false, true):
state.appInitializationState = .keysMissing
// TODO: error we need to handle, issue #221 (https://github.com/zcash/secant-ios-wallet/issues/221)
case (true, false), (true, true):
return Effect(value: .initializeApp)
}
} catch CocoaError.fileNoSuchFile, CocoaError.fileReadNoSuchFile {
state.appInitializationState = .filesMissing
} catch {
state.appInitializationState = .failed
// TODO: error we need to handle, issue #221 (https://github.com/zcash/secant-ios-wallet/issues/221)
}
if state.appInitializationState == .uninitialized || state.appInitializationState == .filesMissing {
return Effect(value: .updateRoute(.onboarding))
.delay(for: 3, scheduler: environment.scheduler)
.eraseToEffect()
}
return .none
/// Stored wallet is present, database files may or may not be present, trying to initialize app state variables and environments.
/// When initialization succeeds user is taken to the home screen.
case .initializeApp:
do {
state.storedWallet = try environment.walletStorage.exportWallet()
} catch {
state.appInitializationState = .failed
// TODO: error we need to handle, issue #221 (https://github.com/zcash/secant-ios-wallet/issues/221)
return .none
}
state.appInitializationState = .initialized
return Effect(value: .updateRoute(.startup))
.delay(for: 3, scheduler: environment.scheduler)
.eraseToEffect()
/// Default is meaningful here because there's `routeReducer` handling routes and this reducer is handling only actions. We don't here plenty of unused cases.
default:
return .none
}
}
2021-12-13 18:16:03 -08:00
private static let routeReducer = AppReducer { state, action, _ in
switch action {
case let .updateRoute(route):
state.route = route
Issue #44: Recovery Phrase Validation flow + tests Rename struct to RecoveryPhraseValidationState. Add docs WordGrid + tests Make Word Groups Droppable and Blue word chips draggable cleanup Rename Stores and adopt aliases and default pattern for reducers Fix drop not working FIX: apply background to header. Spacing Fix compilation errors. Add validation demo to AppView Fix: the empty chips are rendered once, because they are not uniquely identifiable Add the Validation screen to the App Home make mutating functions static fix project warnings Fix Tests Fixed .complete test refactoring the Enum. first step Move given() to RecoveryPhraseValidationState and fix tests Add canary test for computed property of State Move RecoveryPhraseValidationStep to a nested type of RecoveryPhraseValidationState rename RecoveryPhraseValidationState.RecoveryPhraseValidationStep to RecoveryPhraseValidationState.Step Move static functions from RecoveryPhraseValidationStep to RecoveryPhraseValidationState Move creational factory methods together to the same extension Remove unused functions remove associated values from Step enum Fix: Avoid Drop being disable between chips 0.0.1-10 add navigation bar to phrase validation demo Reduce spacing between groups. Code cleanup Remove RecoveryPhraseValidationStep.swift Move remaining code to proper places PR Fixes. Move .initial factory method to test target. Rename given() to apply(chip:group:) and make it a member function Cleanup. Remove .validate, .invalid and .valid states. Figure word chips out of the state. Fix randomIndices() Tie view's title to state Connect Header to State BlueChip is now ColoredChip. Success Screen fix project Connect Success Screen to successful validation Add Red color to backgrounds Validation Failed Screen Connect SuccessValidation Screen to home hide back button on Success view Connect Phrase Display to validation 0.0.1-11 Fix word grid background colors View Modifier to add scrollview when the content is being scaled up by DynamicType Adjust UI spacing and padding to designs Add Placeholder states for SwiftUI Previews Flatten EnumeratedChip Hierarchy Flatten EnumeratedChip view hierarchy Fix: LazyVGrid can't take GeometryReader on its items' bodies Fix: Colored Chip does not adjust Fix: Vertical separation between wordgroups is too tall. Fix: Accesibility fixes for Validation Failed screen Rename ValidationFailedView Accessibility Pass on Validation success screen FIX: Colored chips too big when scaled up Fix: ValidationFailedScreen does not scroll well when scaled up Fix Empty chip shadow color for dark color scheme Fix: chip grid background does not bleed out to bottom of the screen build 12 Fix: pre success/failure screen step shrinks the screen because word grid is missing Resolved PR comments Fixes to resolve PR conversations Fixes to resolve PR conversations Fix PhraseChip preview Make ScrollableWhenScaledUp modifier fileprivate Remove comments and clean up code Fix Swiftlint issues Renamed RecoveryPhraseStepFulfillment to ValidationWord Rename pickWordsFromMissingIndices PR fixes PR suggestions PR suggestions Move words(fromMissingIndices:size) to RecoveryPhrase Make ScrollableWhenScaled struct fileprivate PR Suggestions Part two PR Suggestion changes remove unused PR suggestions suggested rename PR suggestions remove apply(chip:into) move that to Reducer Formatting changes more formatting changes Fix: iPhone 13 Pro Max displays 4 columns instead of three Fix: Recovery Phrase puzzle shows incorrect number of columns and margin alignment on bigger devices Add test to catch state not changing as intended Phrase validation reducer refactor + tests make step computed property a bool make isComplete a single line PR Suggestions Rename ValidationSuccededView.swift Fix Bug: valid phrase should contemplate that the phrase is complete first PR Suggestion refactor and add Unit Tests for resultingPhrase, isComplete, isValid
2021-12-13 12:50:04 -08:00
case .home(.reset):
state.route = .startup
Issue #44: Recovery Phrase Validation flow + tests Rename struct to RecoveryPhraseValidationState. Add docs WordGrid + tests Make Word Groups Droppable and Blue word chips draggable cleanup Rename Stores and adopt aliases and default pattern for reducers Fix drop not working FIX: apply background to header. Spacing Fix compilation errors. Add validation demo to AppView Fix: the empty chips are rendered once, because they are not uniquely identifiable Add the Validation screen to the App Home make mutating functions static fix project warnings Fix Tests Fixed .complete test refactoring the Enum. first step Move given() to RecoveryPhraseValidationState and fix tests Add canary test for computed property of State Move RecoveryPhraseValidationStep to a nested type of RecoveryPhraseValidationState rename RecoveryPhraseValidationState.RecoveryPhraseValidationStep to RecoveryPhraseValidationState.Step Move static functions from RecoveryPhraseValidationStep to RecoveryPhraseValidationState Move creational factory methods together to the same extension Remove unused functions remove associated values from Step enum Fix: Avoid Drop being disable between chips 0.0.1-10 add navigation bar to phrase validation demo Reduce spacing between groups. Code cleanup Remove RecoveryPhraseValidationStep.swift Move remaining code to proper places PR Fixes. Move .initial factory method to test target. Rename given() to apply(chip:group:) and make it a member function Cleanup. Remove .validate, .invalid and .valid states. Figure word chips out of the state. Fix randomIndices() Tie view's title to state Connect Header to State BlueChip is now ColoredChip. Success Screen fix project Connect Success Screen to successful validation Add Red color to backgrounds Validation Failed Screen Connect SuccessValidation Screen to home hide back button on Success view Connect Phrase Display to validation 0.0.1-11 Fix word grid background colors View Modifier to add scrollview when the content is being scaled up by DynamicType Adjust UI spacing and padding to designs Add Placeholder states for SwiftUI Previews Flatten EnumeratedChip Hierarchy Flatten EnumeratedChip view hierarchy Fix: LazyVGrid can't take GeometryReader on its items' bodies Fix: Colored Chip does not adjust Fix: Vertical separation between wordgroups is too tall. Fix: Accesibility fixes for Validation Failed screen Rename ValidationFailedView Accessibility Pass on Validation success screen FIX: Colored chips too big when scaled up Fix: ValidationFailedScreen does not scroll well when scaled up Fix Empty chip shadow color for dark color scheme Fix: chip grid background does not bleed out to bottom of the screen build 12 Fix: pre success/failure screen step shrinks the screen because word grid is missing Resolved PR comments Fixes to resolve PR conversations Fixes to resolve PR conversations Fix PhraseChip preview Make ScrollableWhenScaledUp modifier fileprivate Remove comments and clean up code Fix Swiftlint issues Renamed RecoveryPhraseStepFulfillment to ValidationWord Rename pickWordsFromMissingIndices PR fixes PR suggestions PR suggestions Move words(fromMissingIndices:size) to RecoveryPhrase Make ScrollableWhenScaled struct fileprivate PR Suggestions Part two PR Suggestion changes remove unused PR suggestions suggested rename PR suggestions remove apply(chip:into) move that to Reducer Formatting changes more formatting changes Fix: iPhone 13 Pro Max displays 4 columns instead of three Fix: Recovery Phrase puzzle shows incorrect number of columns and margin alignment on bigger devices Add test to catch state not changing as intended Phrase validation reducer refactor + tests make step computed property a bool make isComplete a single line PR Suggestions Rename ValidationSuccededView.swift Fix Bug: valid phrase should contemplate that the phrase is complete first PR Suggestion refactor and add Unit Tests for resultingPhrase, isComplete, isValid
2021-12-13 12:50:04 -08:00
case .onboarding(.createNewWallet):
return Effect(value: .createNewWallet)
case .phraseValidation(.proceedToHome):
state.route = .home
Issue #44: Recovery Phrase Validation flow + tests Rename struct to RecoveryPhraseValidationState. Add docs WordGrid + tests Make Word Groups Droppable and Blue word chips draggable cleanup Rename Stores and adopt aliases and default pattern for reducers Fix drop not working FIX: apply background to header. Spacing Fix compilation errors. Add validation demo to AppView Fix: the empty chips are rendered once, because they are not uniquely identifiable Add the Validation screen to the App Home make mutating functions static fix project warnings Fix Tests Fixed .complete test refactoring the Enum. first step Move given() to RecoveryPhraseValidationState and fix tests Add canary test for computed property of State Move RecoveryPhraseValidationStep to a nested type of RecoveryPhraseValidationState rename RecoveryPhraseValidationState.RecoveryPhraseValidationStep to RecoveryPhraseValidationState.Step Move static functions from RecoveryPhraseValidationStep to RecoveryPhraseValidationState Move creational factory methods together to the same extension Remove unused functions remove associated values from Step enum Fix: Avoid Drop being disable between chips 0.0.1-10 add navigation bar to phrase validation demo Reduce spacing between groups. Code cleanup Remove RecoveryPhraseValidationStep.swift Move remaining code to proper places PR Fixes. Move .initial factory method to test target. Rename given() to apply(chip:group:) and make it a member function Cleanup. Remove .validate, .invalid and .valid states. Figure word chips out of the state. Fix randomIndices() Tie view's title to state Connect Header to State BlueChip is now ColoredChip. Success Screen fix project Connect Success Screen to successful validation Add Red color to backgrounds Validation Failed Screen Connect SuccessValidation Screen to home hide back button on Success view Connect Phrase Display to validation 0.0.1-11 Fix word grid background colors View Modifier to add scrollview when the content is being scaled up by DynamicType Adjust UI spacing and padding to designs Add Placeholder states for SwiftUI Previews Flatten EnumeratedChip Hierarchy Flatten EnumeratedChip view hierarchy Fix: LazyVGrid can't take GeometryReader on its items' bodies Fix: Colored Chip does not adjust Fix: Vertical separation between wordgroups is too tall. Fix: Accesibility fixes for Validation Failed screen Rename ValidationFailedView Accessibility Pass on Validation success screen FIX: Colored chips too big when scaled up Fix: ValidationFailedScreen does not scroll well when scaled up Fix Empty chip shadow color for dark color scheme Fix: chip grid background does not bleed out to bottom of the screen build 12 Fix: pre success/failure screen step shrinks the screen because word grid is missing Resolved PR comments Fixes to resolve PR conversations Fixes to resolve PR conversations Fix PhraseChip preview Make ScrollableWhenScaledUp modifier fileprivate Remove comments and clean up code Fix Swiftlint issues Renamed RecoveryPhraseStepFulfillment to ValidationWord Rename pickWordsFromMissingIndices PR fixes PR suggestions PR suggestions Move words(fromMissingIndices:size) to RecoveryPhrase Make ScrollableWhenScaled struct fileprivate PR Suggestions Part two PR Suggestion changes remove unused PR suggestions suggested rename PR suggestions remove apply(chip:into) move that to Reducer Formatting changes more formatting changes Fix: iPhone 13 Pro Max displays 4 columns instead of three Fix: Recovery Phrase puzzle shows incorrect number of columns and margin alignment on bigger devices Add test to catch state not changing as intended Phrase validation reducer refactor + tests make step computed property a bool make isComplete a single line PR Suggestions Rename ValidationSuccededView.swift Fix Bug: valid phrase should contemplate that the phrase is complete first PR Suggestion refactor and add Unit Tests for resultingPhrase, isComplete, isValid
2021-12-13 12:50:04 -08:00
case .phraseValidation(.displayBackedUpPhrase),
.phraseDisplay(.createPhrase):
state.route = .phraseDisplay
case .phraseDisplay(.finishedPressed):
state.route = .phraseValidation
/// Default is meaningful here because there's `appReducer` handling actions and this reducer is handling only routes. We don't here plenty of unused cases.
default:
break
}
Issue #44: Recovery Phrase Validation flow + tests Rename struct to RecoveryPhraseValidationState. Add docs WordGrid + tests Make Word Groups Droppable and Blue word chips draggable cleanup Rename Stores and adopt aliases and default pattern for reducers Fix drop not working FIX: apply background to header. Spacing Fix compilation errors. Add validation demo to AppView Fix: the empty chips are rendered once, because they are not uniquely identifiable Add the Validation screen to the App Home make mutating functions static fix project warnings Fix Tests Fixed .complete test refactoring the Enum. first step Move given() to RecoveryPhraseValidationState and fix tests Add canary test for computed property of State Move RecoveryPhraseValidationStep to a nested type of RecoveryPhraseValidationState rename RecoveryPhraseValidationState.RecoveryPhraseValidationStep to RecoveryPhraseValidationState.Step Move static functions from RecoveryPhraseValidationStep to RecoveryPhraseValidationState Move creational factory methods together to the same extension Remove unused functions remove associated values from Step enum Fix: Avoid Drop being disable between chips 0.0.1-10 add navigation bar to phrase validation demo Reduce spacing between groups. Code cleanup Remove RecoveryPhraseValidationStep.swift Move remaining code to proper places PR Fixes. Move .initial factory method to test target. Rename given() to apply(chip:group:) and make it a member function Cleanup. Remove .validate, .invalid and .valid states. Figure word chips out of the state. Fix randomIndices() Tie view's title to state Connect Header to State BlueChip is now ColoredChip. Success Screen fix project Connect Success Screen to successful validation Add Red color to backgrounds Validation Failed Screen Connect SuccessValidation Screen to home hide back button on Success view Connect Phrase Display to validation 0.0.1-11 Fix word grid background colors View Modifier to add scrollview when the content is being scaled up by DynamicType Adjust UI spacing and padding to designs Add Placeholder states for SwiftUI Previews Flatten EnumeratedChip Hierarchy Flatten EnumeratedChip view hierarchy Fix: LazyVGrid can't take GeometryReader on its items' bodies Fix: Colored Chip does not adjust Fix: Vertical separation between wordgroups is too tall. Fix: Accesibility fixes for Validation Failed screen Rename ValidationFailedView Accessibility Pass on Validation success screen FIX: Colored chips too big when scaled up Fix: ValidationFailedScreen does not scroll well when scaled up Fix Empty chip shadow color for dark color scheme Fix: chip grid background does not bleed out to bottom of the screen build 12 Fix: pre success/failure screen step shrinks the screen because word grid is missing Resolved PR comments Fixes to resolve PR conversations Fixes to resolve PR conversations Fix PhraseChip preview Make ScrollableWhenScaledUp modifier fileprivate Remove comments and clean up code Fix Swiftlint issues Renamed RecoveryPhraseStepFulfillment to ValidationWord Rename pickWordsFromMissingIndices PR fixes PR suggestions PR suggestions Move words(fromMissingIndices:size) to RecoveryPhrase Make ScrollableWhenScaled struct fileprivate PR Suggestions Part two PR Suggestion changes remove unused PR suggestions suggested rename PR suggestions remove apply(chip:into) move that to Reducer Formatting changes more formatting changes Fix: iPhone 13 Pro Max displays 4 columns instead of three Fix: Recovery Phrase puzzle shows incorrect number of columns and margin alignment on bigger devices Add test to catch state not changing as intended Phrase validation reducer refactor + tests make step computed property a bool make isComplete a single line PR Suggestions Rename ValidationSuccededView.swift Fix Bug: valid phrase should contemplate that the phrase is complete first PR Suggestion refactor and add Unit Tests for resultingPhrase, isComplete, isValid
2021-12-13 12:50:04 -08:00
return .none
}
private static let homeReducer: AppReducer = HomeReducer.default.pullback(
state: \AppState.homeState,
action: /AppAction.home,
environment: { _ in }
)
private static let onboardingReducer: AppReducer = OnboardingReducer.default.pullback(
state: \AppState.onboardingState,
action: /AppAction.onboarding,
2021-12-13 18:16:03 -08:00
environment: { _ in }
)
Issue #44: Recovery Phrase Validation flow + tests Rename struct to RecoveryPhraseValidationState. Add docs WordGrid + tests Make Word Groups Droppable and Blue word chips draggable cleanup Rename Stores and adopt aliases and default pattern for reducers Fix drop not working FIX: apply background to header. Spacing Fix compilation errors. Add validation demo to AppView Fix: the empty chips are rendered once, because they are not uniquely identifiable Add the Validation screen to the App Home make mutating functions static fix project warnings Fix Tests Fixed .complete test refactoring the Enum. first step Move given() to RecoveryPhraseValidationState and fix tests Add canary test for computed property of State Move RecoveryPhraseValidationStep to a nested type of RecoveryPhraseValidationState rename RecoveryPhraseValidationState.RecoveryPhraseValidationStep to RecoveryPhraseValidationState.Step Move static functions from RecoveryPhraseValidationStep to RecoveryPhraseValidationState Move creational factory methods together to the same extension Remove unused functions remove associated values from Step enum Fix: Avoid Drop being disable between chips 0.0.1-10 add navigation bar to phrase validation demo Reduce spacing between groups. Code cleanup Remove RecoveryPhraseValidationStep.swift Move remaining code to proper places PR Fixes. Move .initial factory method to test target. Rename given() to apply(chip:group:) and make it a member function Cleanup. Remove .validate, .invalid and .valid states. Figure word chips out of the state. Fix randomIndices() Tie view's title to state Connect Header to State BlueChip is now ColoredChip. Success Screen fix project Connect Success Screen to successful validation Add Red color to backgrounds Validation Failed Screen Connect SuccessValidation Screen to home hide back button on Success view Connect Phrase Display to validation 0.0.1-11 Fix word grid background colors View Modifier to add scrollview when the content is being scaled up by DynamicType Adjust UI spacing and padding to designs Add Placeholder states for SwiftUI Previews Flatten EnumeratedChip Hierarchy Flatten EnumeratedChip view hierarchy Fix: LazyVGrid can't take GeometryReader on its items' bodies Fix: Colored Chip does not adjust Fix: Vertical separation between wordgroups is too tall. Fix: Accesibility fixes for Validation Failed screen Rename ValidationFailedView Accessibility Pass on Validation success screen FIX: Colored chips too big when scaled up Fix: ValidationFailedScreen does not scroll well when scaled up Fix Empty chip shadow color for dark color scheme Fix: chip grid background does not bleed out to bottom of the screen build 12 Fix: pre success/failure screen step shrinks the screen because word grid is missing Resolved PR comments Fixes to resolve PR conversations Fixes to resolve PR conversations Fix PhraseChip preview Make ScrollableWhenScaledUp modifier fileprivate Remove comments and clean up code Fix Swiftlint issues Renamed RecoveryPhraseStepFulfillment to ValidationWord Rename pickWordsFromMissingIndices PR fixes PR suggestions PR suggestions Move words(fromMissingIndices:size) to RecoveryPhrase Make ScrollableWhenScaled struct fileprivate PR Suggestions Part two PR Suggestion changes remove unused PR suggestions suggested rename PR suggestions remove apply(chip:into) move that to Reducer Formatting changes more formatting changes Fix: iPhone 13 Pro Max displays 4 columns instead of three Fix: Recovery Phrase puzzle shows incorrect number of columns and margin alignment on bigger devices Add test to catch state not changing as intended Phrase validation reducer refactor + tests make step computed property a bool make isComplete a single line PR Suggestions Rename ValidationSuccededView.swift Fix Bug: valid phrase should contemplate that the phrase is complete first PR Suggestion refactor and add Unit Tests for resultingPhrase, isComplete, isValid
2021-12-13 12:50:04 -08:00
private static let phraseValidationReducer: AppReducer = RecoveryPhraseValidationReducer.default.pullback(
state: \AppState.phraseValidationState,
action: /AppAction.phraseValidation,
environment: { _ in BackupPhraseEnvironment.demo }
)
private static let phraseDisplayReducer: AppReducer = RecoveryPhraseDisplayReducer.default.pullback(
state: \AppState.phraseDisplayState,
action: /AppAction.phraseDisplay,
environment: { _ in BackupPhraseEnvironment.demo }
)
}
// MARK: - AppStore
typealias AppStore = Store<AppState, AppAction>
extension AppStore {
static var placeholder: AppStore {
AppStore(
initialState: .placeholder,
reducer: .default,
environment: .mock
)
}
}
// MARK: - AppViewStore
typealias AppViewStore = ViewStore<AppState, AppAction>
extension AppViewStore {
}
// MARK: PlaceHolders
extension AppState {
static var placeholder: Self {
.init(
homeState: .placeholder,
onboardingState: .init(
importWalletState: .placeholder
),
Issue #44: Recovery Phrase Validation flow + tests Rename struct to RecoveryPhraseValidationState. Add docs WordGrid + tests Make Word Groups Droppable and Blue word chips draggable cleanup Rename Stores and adopt aliases and default pattern for reducers Fix drop not working FIX: apply background to header. Spacing Fix compilation errors. Add validation demo to AppView Fix: the empty chips are rendered once, because they are not uniquely identifiable Add the Validation screen to the App Home make mutating functions static fix project warnings Fix Tests Fixed .complete test refactoring the Enum. first step Move given() to RecoveryPhraseValidationState and fix tests Add canary test for computed property of State Move RecoveryPhraseValidationStep to a nested type of RecoveryPhraseValidationState rename RecoveryPhraseValidationState.RecoveryPhraseValidationStep to RecoveryPhraseValidationState.Step Move static functions from RecoveryPhraseValidationStep to RecoveryPhraseValidationState Move creational factory methods together to the same extension Remove unused functions remove associated values from Step enum Fix: Avoid Drop being disable between chips 0.0.1-10 add navigation bar to phrase validation demo Reduce spacing between groups. Code cleanup Remove RecoveryPhraseValidationStep.swift Move remaining code to proper places PR Fixes. Move .initial factory method to test target. Rename given() to apply(chip:group:) and make it a member function Cleanup. Remove .validate, .invalid and .valid states. Figure word chips out of the state. Fix randomIndices() Tie view's title to state Connect Header to State BlueChip is now ColoredChip. Success Screen fix project Connect Success Screen to successful validation Add Red color to backgrounds Validation Failed Screen Connect SuccessValidation Screen to home hide back button on Success view Connect Phrase Display to validation 0.0.1-11 Fix word grid background colors View Modifier to add scrollview when the content is being scaled up by DynamicType Adjust UI spacing and padding to designs Add Placeholder states for SwiftUI Previews Flatten EnumeratedChip Hierarchy Flatten EnumeratedChip view hierarchy Fix: LazyVGrid can't take GeometryReader on its items' bodies Fix: Colored Chip does not adjust Fix: Vertical separation between wordgroups is too tall. Fix: Accesibility fixes for Validation Failed screen Rename ValidationFailedView Accessibility Pass on Validation success screen FIX: Colored chips too big when scaled up Fix: ValidationFailedScreen does not scroll well when scaled up Fix Empty chip shadow color for dark color scheme Fix: chip grid background does not bleed out to bottom of the screen build 12 Fix: pre success/failure screen step shrinks the screen because word grid is missing Resolved PR comments Fixes to resolve PR conversations Fixes to resolve PR conversations Fix PhraseChip preview Make ScrollableWhenScaledUp modifier fileprivate Remove comments and clean up code Fix Swiftlint issues Renamed RecoveryPhraseStepFulfillment to ValidationWord Rename pickWordsFromMissingIndices PR fixes PR suggestions PR suggestions Move words(fromMissingIndices:size) to RecoveryPhrase Make ScrollableWhenScaled struct fileprivate PR Suggestions Part two PR Suggestion changes remove unused PR suggestions suggested rename PR suggestions remove apply(chip:into) move that to Reducer Formatting changes more formatting changes Fix: iPhone 13 Pro Max displays 4 columns instead of three Fix: Recovery Phrase puzzle shows incorrect number of columns and margin alignment on bigger devices Add test to catch state not changing as intended Phrase validation reducer refactor + tests make step computed property a bool make isComplete a single line PR Suggestions Rename ValidationSuccededView.swift Fix Bug: valid phrase should contemplate that the phrase is complete first PR Suggestion refactor and add Unit Tests for resultingPhrase, isComplete, isValid
2021-12-13 12:50:04 -08:00
phraseValidationState: RecoveryPhraseValidationState.placeholder,
phraseDisplayState: RecoveryPhraseDisplayState(
phrase: .placeholder
)
)
}
}