fix location that was being excluded from index

This commit is contained in:
Francisco Gindre 2021-08-24 19:27:45 -03:00
parent 0a6ebdfb46
commit 55a93540c2
4 changed files with 109 additions and 15 deletions

View File

@ -26,9 +26,9 @@
0D32282E26C5870B00262533 /* SendScreenViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0D32282C26C5870B00262533 /* SendScreenViewModel.swift */; };
0D32283226C5877A00262533 /* BalanceScreen.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0D32283026C5877A00262533 /* BalanceScreen.swift */; };
0D32283326C5877A00262533 /* BalanceScreenViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0D32283126C5877A00262533 /* BalanceScreenViewModel.swift */; };
0D354A0326D5A63200315F45 /* MnemonicSeedPhraseHandling.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0D1922F326BDE5F200052649 /* MnemonicSeedPhraseHandling.swift */; };
0D354A0426D5A63700315F45 /* Services.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0D1922EE26BDE1A300052649 /* Services.swift */; };
0D354A0526D5A63A00315F45 /* KeyStoring.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0D1922F526BDE74500052649 /* KeyStoring.swift */; };
0D354A0926D5A9D000315F45 /* Services.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0D354A0626D5A9D000315F45 /* Services.swift */; };
0D354A0A26D5A9D000315F45 /* KeyStoring.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0D354A0726D5A9D000315F45 /* KeyStoring.swift */; };
0D354A0B26D5A9D000315F45 /* MnemonicSeedPhraseHandling.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0D354A0826D5A9D000315F45 /* MnemonicSeedPhraseHandling.swift */; };
0D4E7A0926B364170058B01E /* SecantApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0D4E7A0826B364170058B01E /* SecantApp.swift */; };
0D4E7A0B26B364170058B01E /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0D4E7A0A26B364170058B01E /* ContentView.swift */; };
0D4E7A0D26B364180058B01E /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 0D4E7A0C26B364180058B01E /* Assets.xcassets */; };
@ -68,10 +68,7 @@
0D170A7126BC802800EB6A46 /* Router.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Router.swift; sourceTree = "<group>"; };
0D1922E926BDD96A00052649 /* ViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewModel.swift; sourceTree = "<group>"; };
0D1922EC26BDE0C600052649 /* AppRouter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppRouter.swift; sourceTree = "<group>"; };
0D1922EE26BDE1A300052649 /* Services.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Services.swift; sourceTree = "<group>"; };
0D1922F126BDE29300052649 /* ZcashSDKStubs.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ZcashSDKStubs.swift; sourceTree = "<group>"; };
0D1922F326BDE5F200052649 /* MnemonicSeedPhraseHandling.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MnemonicSeedPhraseHandling.swift; sourceTree = "<group>"; };
0D1922F526BDE74500052649 /* KeyStoring.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KeyStoring.swift; sourceTree = "<group>"; };
0D1922F726BDEB3500052649 /* MockServices.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MockServices.swift; sourceTree = "<group>"; };
0D2ACE7F26C2C67100D62E3C /* Zboto.otf */ = {isa = PBXFileReference; lastKnownFileType = file; path = Zboto.otf; sourceTree = "<group>"; };
0D2ACE8226C2C8B400D62E3C /* SwiftUI+secant.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "SwiftUI+secant.swift"; sourceTree = "<group>"; };
@ -87,6 +84,9 @@
0D32282C26C5870B00262533 /* SendScreenViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SendScreenViewModel.swift; sourceTree = "<group>"; };
0D32283026C5877A00262533 /* BalanceScreen.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BalanceScreen.swift; sourceTree = "<group>"; };
0D32283126C5877A00262533 /* BalanceScreenViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BalanceScreenViewModel.swift; sourceTree = "<group>"; };
0D354A0626D5A9D000315F45 /* Services.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Services.swift; sourceTree = "<group>"; };
0D354A0726D5A9D000315F45 /* KeyStoring.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = KeyStoring.swift; sourceTree = "<group>"; };
0D354A0826D5A9D000315F45 /* MnemonicSeedPhraseHandling.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MnemonicSeedPhraseHandling.swift; sourceTree = "<group>"; };
0D4E7A0526B364170058B01E /* secant-testnet.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "secant-testnet.app"; sourceTree = BUILT_PRODUCTS_DIR; };
0D4E7A0826B364170058B01E /* SecantApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SecantApp.swift; sourceTree = "<group>"; };
0D4E7A0A26B364170058B01E /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = "<group>"; };
@ -144,14 +144,14 @@
path = Routers;
sourceTree = "<group>";
};
0D170A7426BC9B7500EB6A46 /* Dependencies */ = {
0D170A7426BC9B7500EB6A46 /* Mocked Dependencies */ = {
isa = PBXGroup;
children = (
0D1922F326BDE5F200052649 /* MnemonicSeedPhraseHandling.swift */,
0D1922EE26BDE1A300052649 /* Services.swift */,
0D1922F526BDE74500052649 /* KeyStoring.swift */,
0D354A0726D5A9D000315F45 /* KeyStoring.swift */,
0D354A0826D5A9D000315F45 /* MnemonicSeedPhraseHandling.swift */,
0D354A0626D5A9D000315F45 /* Services.swift */,
);
path = Dependencies;
path = "Mocked Dependencies";
sourceTree = "<group>";
};
0D1922E826BDD95000052649 /* Base */ = {
@ -289,7 +289,7 @@
0D1922F026BDE27D00052649 /* Stubs */,
0D1922EB26BDD9A500052649 /* Screens */,
0D1922E826BDD95000052649 /* Base */,
0D170A7426BC9B7500EB6A46 /* Dependencies */,
0D170A7426BC9B7500EB6A46 /* Mocked Dependencies */,
0D4E7A0826B364170058B01E /* SecantApp.swift */,
0D4E7A0A26B364170058B01E /* ContentView.swift */,
0D4E7A0C26B364180058B01E /* Assets.xcassets */,
@ -514,7 +514,7 @@
0D1922ED26BDE0C600052649 /* AppRouter.swift in Sources */,
0D1922F226BDE29300052649 /* ZcashSDKStubs.swift in Sources */,
0DA13C9D26C1942100E3B610 /* BackupWalletScreenViewModel.swift in Sources */,
0D354A0326D5A63200315F45 /* MnemonicSeedPhraseHandling.swift in Sources */,
0D354A0B26D5A9D000315F45 /* MnemonicSeedPhraseHandling.swift in Sources */,
0D32281E26C5867D00262533 /* ScanQrScreen.swift in Sources */,
0DA13C9C26C1942100E3B610 /* BackupWalletScreen.swift in Sources */,
0DA13C9826C186FF00E3B610 /* RestoreWalletScreenViewModel.swift in Sources */,
@ -524,18 +524,18 @@
0D1922F826BDEB3500052649 /* MockServices.swift in Sources */,
0D4E7A0B26B364170058B01E /* ContentView.swift in Sources */,
0D170A7226BC802800EB6A46 /* Router.swift in Sources */,
0D354A0926D5A9D000315F45 /* Services.swift in Sources */,
0DA13C9726C186FF00E3B610 /* RestoreWalletScreen.swift in Sources */,
0D1922EA26BDD96A00052649 /* ViewModel.swift in Sources */,
0D4E7A0926B364170058B01E /* SecantApp.swift in Sources */,
0D32281A26C5864B00262533 /* ProfileScreenViewModel.swift in Sources */,
0DA13CA126C1955600E3B610 /* HomeScreen.swift in Sources */,
0D354A0526D5A63A00315F45 /* KeyStoring.swift in Sources */,
0DA13C9026C15D1D00E3B610 /* WelcomeScreenViewModel.swift in Sources */,
0DA13C8F26C15D1D00E3B610 /* WelcomeScreen.swift in Sources */,
0DA13C9326C15E2F00E3B610 /* PlainButton.swift in Sources */,
0D354A0426D5A63700315F45 /* Services.swift in Sources */,
0D32282826C586E000262533 /* RequestZcashScreen.swift in Sources */,
0D32283226C5877A00262533 /* BalanceScreen.swift in Sources */,
0D354A0A26D5A9D000315F45 /* KeyStoring.swift in Sources */,
0DA13CA226C1955600E3B610 /* HomeScreenViewModel.swift in Sources */,
0D32282926C586E000262533 /* RequestZcashScreenViewModel.swift in Sources */,
0D2ACE8326C2C8B400D62E3C /* SwiftUI+secant.swift in Sources */,

View File

@ -0,0 +1,36 @@
//
// KeyStoring.swift
// secant
//
// Created by Francisco Gindre on 8/6/21.
//
import Foundation
protocol KeyStoring {
func importBirthday(_ height: BlockHeight) throws
func exportBirthday() throws -> BlockHeight
func importPhrase(bip39 phrase: String) throws
func exportPhrase() throws -> String
var keysPresent: Bool { get }
/**
Use carefully: Deletes the seed phrase from the keychain
*/
func nukePhrase()
/**
Use carefully: deletes the wallet birthday from the keychain
*/
func nukeBirthday()
/**
There's no fate but what we make for ourselves - Sarah Connor
*/
func nukeWallet()
}
enum KeyStoringError : Error {
case alreadyImported
case uninitializedWallet
}

View File

@ -0,0 +1,39 @@
//
// MnemonicSeedPhraseHandling.swift
// wallet
//
// Created by Francisco Gindre on 2/28/20.
// Copyright © 2020 Francisco Gindre. All rights reserved.
//
import Foundation
enum MnemonicError: Error {
case invalidSeed
case checksumFailed
}
protocol MnemonicSeedPhraseHandling {
/**
random 24 words mnemonic phrase
*/
func randomMnemonic() throws -> String
/**
random 24 words mnemonic phrase as array of words
*/
func randomMnemonicWords() throws -> [String]
/**
generate deterministic seed from mnemonic phrase
*/
func toSeed(mnemonic: String) throws -> [UInt8]
/**
get this mnemonic
*/
func asWords(mnemonic: String) throws -> [String]
/**
validates whether the given mnemonic is correct
*/
func isValid(mnemonic: String) throws
}

View File

@ -0,0 +1,19 @@
//
// Services.swift
// secant
//
// Created by Francisco Gindre on 8/6/21.
//
import Foundation
protocol Services {
var networkProvider: ZcashNetworkProvider { get }
var seedHandler: MnemonicSeedPhraseHandling { get }
var keyStorage: KeyStoring { get }
}
protocol ZcashNetworkProvider {
func currentNetwork() -> ZcashNetwork
}