Mnemonic swift update (#178)

* Update to use latest MnemonicSwift + tests

* add tests to no-logging target

* hook up tests

* change dependecy to https

* change sdk to httpfunctionss

* fix xcodebuild travis

* use latest master of MnemonicSwift

* Fix: don't capitalize seed

* bump build number

* fix tests

* fix seed backup screen

* add generated file to no logging target to fix ci
This commit is contained in:
Francisco Gindre 2020-09-10 23:33:14 -03:00 committed by GitHub
parent 49517b746d
commit fbeeba2430
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
21 changed files with 386 additions and 172 deletions

View File

@ -23,4 +23,4 @@ install:
script:
- travis_wait 60 xcodebuild -quiet -workspace ${TRAVIS_BUILD_DIR}/wallet/ECC-Wallet.xcworkspace -scheme ECC-Wallet-no-logging -destination platform\=iOS\ Simulator,OS\=13.2.2,name\=iPhone\ 8 build
- travis_wait 60 xcodebuild -quiet -workspace ${TRAVIS_BUILD_DIR}/wallet/ECC-Wallet.xcworkspace -scheme ECC-Wallet-no-logging -destination platform\=iOS\ Simulator,OS\=13.2.2,name\=iPhone\ 8 test

View File

@ -210,6 +210,7 @@
0DF3075524DB4A440080B0CF /* lottie_sending.json in Resources */ = {isa = PBXBuildFile; fileRef = 0DF3075224DB4A440080B0CF /* lottie_sending.json */; };
0DF3075624DB4A440080B0CF /* lottie_success.json in Resources */ = {isa = PBXBuildFile; fileRef = 0DF3075324DB4A440080B0CF /* lottie_success.json */; };
0DF3075724DB4A440080B0CF /* lottie_success.json in Resources */ = {isa = PBXBuildFile; fileRef = 0DF3075324DB4A440080B0CF /* lottie_success.json */; };
0DF67CB8250AF9080091C763 /* Constants.generated.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0DE8668424BCE55400F3B883 /* Constants.generated.swift */; };
0DFC0CF123C7787F0009DD7E /* ZcashHoldToSendButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0DFC0CF023C7787F0009DD7E /* ZcashHoldToSendButton.swift */; };
0DFC0CF323C8EA1C0009DD7E /* ZcashCloseButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0DFC0CF223C8EA1C0009DD7E /* ZcashCloseButton.swift */; };
8D3F362524A40FCF0087687A /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = 8D3F362724A40FCF0087687A /* Localizable.strings */; };
@ -234,6 +235,20 @@
remoteGlobalIDString = 0D1250FE23B557E40014EE3A;
remoteInfo = wallet;
};
0DF67CB4250AC9F30091C763 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 0D1250F723B557E40014EE3A /* Project object */;
proxyType = 1;
remoteGlobalIDString = 0DCDFF9324B6722B000F6999;
remoteInfo = "ECC-Wallet-no-logging";
};
0DF904512502FE4300328C5A /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 0D1250F723B557E40014EE3A /* Project object */;
proxyType = 1;
remoteGlobalIDString = 0DCDFF9324B6722B000F6999;
remoteInfo = "ECC-Wallet-no-logging";
};
/* End PBXContainerItemProxy section */
/* Begin PBXFileReference section */
@ -720,11 +735,13 @@
0D12511123B557E60014EE3A /* Sources */,
0D12511223B557E60014EE3A /* Frameworks */,
0D12511323B557E60014EE3A /* Resources */,
70CEA1A652FAED2ACEFBD6EA /* [CP] Embed Pods Frameworks */,
);
buildRules = (
);
dependencies = (
0D12511723B557E60014EE3A /* PBXTargetDependency */,
0DF67CB5250AC9F30091C763 /* PBXTargetDependency */,
);
name = "ECC-WalletTests";
productName = walletTests;
@ -739,11 +756,13 @@
0D12511C23B557E60014EE3A /* Sources */,
0D12511D23B557E60014EE3A /* Frameworks */,
0D12511E23B557E60014EE3A /* Resources */,
A40CFDDA0912AA038984C3FB /* Upload Bugsnag dSYM */,
);
buildRules = (
);
dependencies = (
0D12512223B557E60014EE3A /* PBXTargetDependency */,
0DF904522502FE4300328C5A /* PBXTargetDependency */,
);
name = "ECC-WalletUITests";
productName = walletUITests;
@ -755,6 +774,7 @@
buildConfigurationList = 0DCDFFE324B6722B000F6999 /* Build configuration list for PBXNativeTarget "ECC-Wallet-no-logging" */;
buildPhases = (
0DCDFF9424B6722B000F6999 /* [CP] Check Pods Manifest.lock */,
0DF67CB3250AC9720091C763 /* ShellScript */,
0DCDFF9624B6722B000F6999 /* Sources */,
0DCDFFD724B6722B000F6999 /* Frameworks */,
0DCDFFD924B6722B000F6999 /* Resources */,
@ -784,11 +804,11 @@
};
0D12511423B557E60014EE3A = {
CreatedOnToolsVersion = 11.3;
TestTargetID = 0D1250FE23B557E40014EE3A;
TestTargetID = 0DCDFF9324B6722B000F6999;
};
0D12511F23B557E60014EE3A = {
CreatedOnToolsVersion = 11.3;
TestTargetID = 0D1250FE23B557E40014EE3A;
TestTargetID = 0DCDFF9324B6722B000F6999;
};
};
};
@ -944,6 +964,40 @@
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-ECC-Wallet-no-logging/Pods-ECC-Wallet-no-logging-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
0DF67CB3250AC9720091C763 /* ShellScript */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
);
outputFileListPaths = (
);
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "source ${SRCROOT}/env-vars.sh\nsh ${PROJECT_DIR}/Scripts/generate_constants.sh\n";
};
70CEA1A652FAED2ACEFBD6EA /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-ECC-WalletTests/Pods-ECC-WalletTests-frameworks-${CONFIGURATION}-input-files.xcfilelist",
);
name = "[CP] Embed Pods Frameworks";
outputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-ECC-WalletTests/Pods-ECC-WalletTests-frameworks-${CONFIGURATION}-output-files.xcfilelist",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-ECC-WalletTests/Pods-ECC-WalletTests-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
8C3EAD89BAA309B5FC123070 /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
@ -966,6 +1020,25 @@
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0;
};
A40CFDDA0912AA038984C3FB /* Upload Bugsnag dSYM */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
);
name = "Upload Bugsnag dSYM";
outputFileListPaths = (
);
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = "/usr/bin/env ruby";
shellScript = "# First, attempt to get the API key from an environment variable\napi_key = ENV[\"BUGSNAG_API_KEY\"]\n\n# If not present, attempt to lookup the value from the Info.plist\nif !api_key\n default_info_plist_location = Dir.glob(\"./{ios/,}*/Info.plist\").reject {|path| path =~ /build|test/i }\n plist_buddy_response = `/usr/libexec/PlistBuddy -c \"print :BugsnagAPIKey\" \"#{default_info_plist_location.first}\"`\n api_key = plist_buddy_response if $?.success?\nend\n\nfork do\n Process.setsid\n STDIN.reopen(\"/dev/null\")\n STDOUT.reopen(\"/dev/null\", \"a\")\n STDERR.reopen(\"/dev/null\", \"a\")\n\n require 'shellwords'\n\n Dir[\"#{ENV[\"DWARF_DSYM_FOLDER_PATH\"]}/*/Contents/Resources/DWARF/*\"].each do |dsym|\n curl_command = \"curl -F dsym=@#{Shellwords.escape(dsym)} -F projectRoot=#{Shellwords.escape(ENV[\"PROJECT_DIR\"])} \"\n curl_command += \"-F apiKey=#{Shellwords.escape(api_key)} \" if api_key\n curl_command += \"https://upload.bugsnag.com/\"\n system(curl_command)\n end\nend\n";
showEnvVarsInLog = 0;
};
AFBFA011C32F80A73756DCC0 /* Upload Bugsnag dSYM */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
@ -1195,6 +1268,7 @@
0DCDFFB624B6722B000F6999 /* CameraAccessHelper.swift in Sources */,
0DCDFFB724B6722B000F6999 /* ZcashHoldToSendButton.swift in Sources */,
0DCDFFB824B6722B000F6999 /* WalletDetailsHeader.swift in Sources */,
0DF67CB8250AF9080091C763 /* Constants.generated.swift in Sources */,
0D2607D824F42C46006FDC36 /* PasteboardHelper.swift in Sources */,
0DCDFFB924B6722B000F6999 /* LottieAnimation.swift in Sources */,
0DCDFFBA24B6722B000F6999 /* ZcashCloseButton.swift in Sources */,
@ -1254,6 +1328,16 @@
target = 0D1250FE23B557E40014EE3A /* ECC-Wallet */;
targetProxy = 0D12512123B557E60014EE3A /* PBXContainerItemProxy */;
};
0DF67CB5250AC9F30091C763 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 0DCDFF9324B6722B000F6999 /* ECC-Wallet-no-logging */;
targetProxy = 0DF67CB4250AC9F30091C763 /* PBXContainerItemProxy */;
};
0DF904522502FE4300328C5A /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 0DCDFF9324B6722B000F6999 /* ECC-Wallet-no-logging */;
targetProxy = 0DF904512502FE4300328C5A /* PBXContainerItemProxy */;
};
/* End PBXTargetDependency section */
/* Begin PBXVariantGroup section */
@ -1399,7 +1483,7 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 52;
CURRENT_PROJECT_VERSION = 53;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_ASSET_PATHS = "\"wallet/Preview Content\"";
DEVELOPMENT_TEAM = RLPRR8CPQG;
@ -1425,7 +1509,7 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 52;
CURRENT_PROJECT_VERSION = 53;
DEVELOPMENT_ASSET_PATHS = "\"wallet/Preview Content\"";
DEVELOPMENT_TEAM = RLPRR8CPQG;
ENABLE_BITCODE = NO;
@ -1463,7 +1547,7 @@
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/ECC Wallet.app/ECC Wallet";
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/ECC-Wallet-no-logs.app/ECC-Wallet-no-logs";
};
name = Debug;
};
@ -1486,7 +1570,7 @@
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/ECC Wallet.app/ECC Wallet";
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/ECC-Wallet-no-logs.app/ECC-Wallet-no-logs";
};
name = Release;
};
@ -1507,7 +1591,7 @@
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
TEST_TARGET_NAME = wallet;
TEST_TARGET_NAME = "ECC-Wallet-no-logging";
};
name = Debug;
};
@ -1528,7 +1612,7 @@
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
TEST_TARGET_NAME = wallet;
TEST_TARGET_NAME = "ECC-Wallet-no-logging";
};
name = Release;
};
@ -1538,7 +1622,7 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 52;
CURRENT_PROJECT_VERSION = 53;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_ASSET_PATHS = "\"wallet/Preview Content\"";
DEVELOPMENT_TEAM = 6J82A38BF9;
@ -1563,7 +1647,7 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 52;
CURRENT_PROJECT_VERSION = 53;
DEVELOPMENT_ASSET_PATHS = "\"wallet/Preview Content\"";
DEVELOPMENT_TEAM = 6J82A38BF9;
ENABLE_BITCODE = NO;

View File

@ -28,6 +28,26 @@
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "0D12511F23B557E60014EE3A"
BuildableName = "ECC-WalletUITests.xctest"
BlueprintName = "ECC-WalletUITests"
ReferencedContainer = "container:ECC-Wallet.xcodeproj">
</BuildableReference>
</TestableReference>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "0D12511423B557E60014EE3A"
BuildableName = "ECC-WalletTests.xctest"
BlueprintName = "ECC-WalletTests"
ReferencedContainer = "container:ECC-Wallet.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
</TestAction>
<LaunchAction

View File

@ -2,10 +2,10 @@ platform :ios, '13.0'
use_frameworks!
def base_pods
pod 'ZcashLightClientKit'
pod 'gRPC-Swift', '= 1.0.0-alpha.17'
pod 'ZcashLightClientKit', :git => 'https://github.com/zcash/ZcashLightClientKit.git', :branch => 'master'
pod 'gRPC-Swift', '= 1.0.0-alpha.19'
pod 'KeychainSwift', '~> 19.0.0'
pod 'MnemonicSwift'
pod 'MnemonicSwift', :git => 'https://github.com/zcash-hackworks/MnemonicSwift.git', :branch => 'master'
pod 'TinyQRScanner'
pod 'lottie-ios'
end
@ -20,15 +20,19 @@ target 'ECC-Wallet' do
base_pods
pod 'Mixpanel-swift'
pod 'Bugsnag'
target 'ECC-WalletTests' do
inherit! :search_paths
end
target 'ECC-WalletUITests' do
inherit! :search_paths
end
end
target 'ECC-WalletTests' do
base_pods
inherit! :search_paths
end
target 'ECC-WalletUITests' do
inherit! :search_paths
end
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|

View File

@ -1,16 +1,16 @@
PODS:
- Bugsnag (6.1.2)
- CGRPCZlib (1.0.0-alpha.17)
- CNIOAtomics (2.20.2)
- CNIOBoringSSL (2.9.0)
- CNIOBoringSSLShims (2.9.0):
- CNIOBoringSSL (= 2.9.0)
- CNIODarwin (2.20.2)
- CNIOHTTPParser (2.20.2)
- CNIOLinux (2.20.2)
- CNIOSHA1 (2.20.2)
- gRPC-Swift (1.0.0-alpha.17):
- CGRPCZlib (= 1.0.0-alpha.17)
- CGRPCZlib (1.0.0-alpha.19)
- CNIOAtomics (2.22.0)
- CNIOBoringSSL (2.9.1)
- CNIOBoringSSLShims (2.9.1):
- CNIOBoringSSL (= 2.9.1)
- CNIODarwin (2.22.0)
- CNIOHTTPParser (2.22.0)
- CNIOLinux (2.22.0)
- CNIOSHA1 (2.22.0)
- gRPC-Swift (1.0.0-alpha.19):
- CGRPCZlib (= 1.0.0-alpha.19)
- Logging (< 2, >= 1.2.0)
- SwiftNIO (< 3, >= 2.19.0)
- SwiftNIOHTTP2 (< 2, >= 1.12.2)
@ -23,62 +23,62 @@ PODS:
- Mixpanel-swift (2.7.7):
- Mixpanel-swift/Complete (= 2.7.7)
- Mixpanel-swift/Complete (2.7.7)
- MnemonicSwift (1.0.0)
- MnemonicSwift (2.0.0)
- SQLite.swift (0.12.2):
- SQLite.swift/standard (= 0.12.2)
- SQLite.swift/standard (0.12.2)
- SwiftNIO (2.20.2):
- CNIOAtomics (= 2.20.2)
- CNIODarwin (= 2.20.2)
- CNIOLinux (= 2.20.2)
- CNIOSHA1 (= 2.20.2)
- SwiftNIOConcurrencyHelpers (= 2.20.2)
- SwiftNIOConcurrencyHelpers (2.20.2):
- CNIOAtomics (= 2.20.2)
- SwiftNIOFoundationCompat (2.20.2):
- SwiftNIO (= 2.20.2)
- SwiftNIOHPACK (1.13.0):
- SwiftNIO (< 3, >= 2.19.0)
- SwiftNIOConcurrencyHelpers (< 3, >= 2.19.0)
- SwiftNIOHTTP1 (< 3, >= 2.19.0)
- SwiftNIOHTTP1 (2.20.2):
- CNIOHTTPParser (= 2.20.2)
- SwiftNIO (= 2.20.2)
- SwiftNIOConcurrencyHelpers (= 2.20.2)
- SwiftNIOHTTP2 (1.13.0):
- SwiftNIO (< 3, >= 2.19.0)
- SwiftNIOConcurrencyHelpers (< 3, >= 2.19.0)
- SwiftNIOHPACK (= 1.13.0)
- SwiftNIOHTTP1 (< 3, >= 2.19.0)
- SwiftNIOTLS (< 3, >= 2.19.0)
- SwiftNIOSSL (2.9.0):
- CNIOBoringSSL (= 2.9.0)
- CNIOBoringSSLShims (= 2.9.0)
- SwiftNIO (< 3, >= 2.19.0)
- SwiftNIOConcurrencyHelpers (< 3, >= 2.19.0)
- SwiftNIOTLS (< 3, >= 2.19.0)
- SwiftNIOTLS (2.20.2):
- SwiftNIO (= 2.20.2)
- SwiftNIOTransportServices (1.8.0):
- SwiftNIO (< 3, >= 2.19.0)
- SwiftNIOConcurrencyHelpers (< 3, >= 2.19.0)
- SwiftNIOFoundationCompat (< 3, >= 2.19.0)
- SwiftNIOTLS (< 3, >= 2.19.0)
- SwiftProtobuf (1.11.0)
- SwiftNIO (2.22.0):
- CNIOAtomics (= 2.22.0)
- CNIODarwin (= 2.22.0)
- CNIOLinux (= 2.22.0)
- CNIOSHA1 (= 2.22.0)
- SwiftNIOConcurrencyHelpers (= 2.22.0)
- SwiftNIOConcurrencyHelpers (2.22.0):
- CNIOAtomics (= 2.22.0)
- SwiftNIOFoundationCompat (2.22.0):
- SwiftNIO (= 2.22.0)
- SwiftNIOHPACK (1.14.1):
- SwiftNIO (< 3, >= 2.22.0)
- SwiftNIOConcurrencyHelpers (< 3, >= 2.22.0)
- SwiftNIOHTTP1 (< 3, >= 2.22.0)
- SwiftNIOHTTP1 (2.22.0):
- CNIOHTTPParser (= 2.22.0)
- SwiftNIO (= 2.22.0)
- SwiftNIOConcurrencyHelpers (= 2.22.0)
- SwiftNIOHTTP2 (1.14.1):
- SwiftNIO (< 3, >= 2.22.0)
- SwiftNIOConcurrencyHelpers (< 3, >= 2.22.0)
- SwiftNIOHPACK (= 1.14.1)
- SwiftNIOHTTP1 (< 3, >= 2.22.0)
- SwiftNIOTLS (< 3, >= 2.22.0)
- SwiftNIOSSL (2.9.1):
- CNIOBoringSSL (= 2.9.1)
- CNIOBoringSSLShims (= 2.9.1)
- SwiftNIO (< 3, >= 2.22.0)
- SwiftNIOConcurrencyHelpers (< 3, >= 2.22.0)
- SwiftNIOTLS (< 3, >= 2.22.0)
- SwiftNIOTLS (2.22.0):
- SwiftNIO (= 2.22.0)
- SwiftNIOTransportServices (1.9.0):
- SwiftNIO (< 3, >= 2.22.0)
- SwiftNIOConcurrencyHelpers (< 3, >= 2.22.0)
- SwiftNIOFoundationCompat (< 3, >= 2.22.0)
- SwiftNIOTLS (< 3, >= 2.22.0)
- SwiftProtobuf (1.12.0)
- TinyQRScanner (1.0.1)
- ZcashLightClientKit (0.6.2):
- gRPC-Swift (= 1.0.0-alpha.17)
- ZcashLightClientKit (0.6.3):
- gRPC-Swift (= 1.0.0-alpha.19)
- SQLite.swift (~> 0.12.2)
DEPENDENCIES:
- Bugsnag
- gRPC-Swift (= 1.0.0-alpha.17)
- gRPC-Swift (= 1.0.0-alpha.19)
- KeychainSwift (~> 19.0.0)
- lottie-ios
- Mixpanel-swift
- MnemonicSwift
- MnemonicSwift (from `https://github.com/zcash-hackworks/MnemonicSwift.git`, branch `master`)
- TinyQRScanner
- ZcashLightClientKit
- ZcashLightClientKit (from `https://github.com/zcash/ZcashLightClientKit.git`, branch `master`)
SPEC REPOS:
trunk:
@ -96,7 +96,6 @@ SPEC REPOS:
- Logging
- lottie-ios
- Mixpanel-swift
- MnemonicSwift
- SQLite.swift
- SwiftNIO
- SwiftNIOConcurrencyHelpers
@ -109,38 +108,53 @@ SPEC REPOS:
- SwiftNIOTransportServices
- SwiftProtobuf
- TinyQRScanner
- ZcashLightClientKit
EXTERNAL SOURCES:
MnemonicSwift:
:branch: master
:git: https://github.com/zcash-hackworks/MnemonicSwift.git
ZcashLightClientKit:
:branch: master
:git: https://github.com/zcash/ZcashLightClientKit.git
CHECKOUT OPTIONS:
MnemonicSwift:
:commit: f1377b9321b23401ffb0052cbb74741fa8dd9898
:git: https://github.com/zcash-hackworks/MnemonicSwift.git
ZcashLightClientKit:
:commit: 14ed1c2106974b00a62ffc6cd7416ded81f18005
:git: https://github.com/zcash/ZcashLightClientKit.git
SPEC CHECKSUMS:
Bugsnag: 67aed7ab92990833e164c2b83a240951ddb1ea33
CGRPCZlib: 245283cd656bf0c309a48a887c27865d6f54f7ef
CNIOAtomics: 7daf6423d00650104436c5f8a2a341679104ae83
CNIOBoringSSL: fb66746214b40dded1a8ddf2e078af0eff07bfb8
CNIOBoringSSLShims: c7a6e1e29088739872e51f70f8305beadfa6ca61
CNIODarwin: 65509d8e6a65a3f3f7bf5b09455cbabd535f48f3
CNIOHTTPParser: ec6aa14852274b383a52bacd4d6bb3d2432a50e9
CNIOLinux: 380e2601f1f32f8f32a78437c5f4f5a688205e2b
CNIOSHA1: 5cc4fc5054beeb21c8e0017ad6bf559ce8095c10
gRPC-Swift: 871cf2df24d9f5424763ae5af7248ed26a1b1314
CGRPCZlib: befd9b92013c647f18aa9b7d9e9231d52e1ced1b
CNIOAtomics: fc22c21538d19cd55cce438146ce0388684601b4
CNIOBoringSSL: ee7722e4355434b420eb06b3ca7535a6cfb09cf2
CNIOBoringSSLShims: e76fde7b7972f242e250f76dafcfdbd23be26eca
CNIODarwin: efb83e040e8409494d0a5beeaa711fc95e7d94e9
CNIOHTTPParser: c5dc715ce6b8c06049b69a9337f8b6af4b2a5ffb
CNIOLinux: 11f69f76c12087a0752fa8a53f32f9853ef3f4f2
CNIOSHA1: ff4d77269adcb89f9a962abcbee55256a29b8a36
gRPC-Swift: 75a7a8d7cd08177165ef971159afb84e5130cfc9
KeychainSwift: a06190cf933ad46b1e0abc3d77d29c06331715c7
Logging: beeb016c9c80cf77042d62e83495816847ef108b
lottie-ios: 48fac6be217c76937e36e340e2d09cf7b10b7f5f
Mixpanel-swift: 3a8fb9ce791e9c64d556b9446aa470b469c6fa7d
MnemonicSwift: d743ec3dcc1cdce706a1876dba0b6250ad1ef90d
MnemonicSwift: 36384fc6b2640d93df9fe9fb60a8da7957cec36d
SQLite.swift: d2b4642190917051ce6bd1d49aab565fe794eea3
SwiftNIO: a3c1b37da3e97ce44b3cfafc61c05fe0cac540b8
SwiftNIOConcurrencyHelpers: cd7afc3d1f1ceaf55bbd030e7d1a469d3024db92
SwiftNIOFoundationCompat: 573f44d5b24f7ead54b6b111264c0a420fc6eccf
SwiftNIOHPACK: 0346ad2091511232c8cf19a6183b9c96ce33baf3
SwiftNIOHTTP1: b54fae8700b647e908597aa7ed3370389f634b87
SwiftNIOHTTP2: 8a0f333b99f9283f457762f58baa30acfee354cb
SwiftNIOSSL: 3e67b565a567c20ed38586ae0b3566f190776a95
SwiftNIOTLS: 9225a214c2483873406322d83c9db3731d8350e9
SwiftNIOTransportServices: e69704b2d41b68a531bf3aa0177fec81ba1361e6
SwiftProtobuf: f889fe5772f90ef7d7b8aac352d1fddf39650713
SwiftNIO: e1995d88785db2db1ad5ee4590e4206b8c2658dc
SwiftNIOConcurrencyHelpers: d591e7cca9f9e61d2352a13303984b86cee2b212
SwiftNIOFoundationCompat: ebf639c373a7a4f074a6a727ba56dad4432a00d9
SwiftNIOHPACK: 25e34368f9633012479e3f9ec6c94d490c5852a9
SwiftNIOHTTP1: 54570af50938aa7ccae65392690401fa90a762ed
SwiftNIOHTTP2: 0ef3020ee88321d4932bf1a1007fa91e7800cbfd
SwiftNIOSSL: 2967e874b40d05904edde5c540c3157621e5ecc4
SwiftNIOTLS: 46bb3a0ff37d6b52ae6baf5207ec3cd411da327c
SwiftNIOTransportServices: 801923921fbecdcde1e1c1ff38e812167d01ead1
SwiftProtobuf: 4ef85479c18ca85b5482b343df9c319c62bda699
TinyQRScanner: 4077088ff2e8d476af79e6035413648c2c7900ef
ZcashLightClientKit: 9ff73c55a1c2a493db96357162dfcd5bac00f7df
ZcashLightClientKit: 6a7a724d5c249bc15983327157fe5ade6600dbcb
PODFILE CHECKSUM: 649565ebda2ec00fc3914f6c476f4e4bb9d02600
PODFILE CHECKSUM: d4f916caef56008f8fca85399c0e256d941c6e19
COCOAPODS: 1.9.3

View File

@ -33,7 +33,7 @@ struct ZcashSeedPhraseGrid_Previews: PreviewProvider {
static var previews: some View {
ZStack {
ZcashBackground()
ZcashSeedPhraseGrid(words: MnemonicSeedProvider.default.asWords(mnemonic: "kitchen renew wide common vague fold vacuum tilt amazing pear square gossip jewel month tree shock scan alpha just spot fluid toilet view dinner")!)
ZcashSeedPhraseGrid(words: try! MnemonicSeedProvider.default.asWords(mnemonic: "kitchen renew wide common vague fold vacuum tilt amazing pear square gossip jewel month tree shock scan alpha just spot fluid toilet view dinner"))
}
}
}

View File

@ -57,7 +57,7 @@ struct ZcashTextField: View {
.foregroundColor(Color.white)
.textContentType(contentType)
.keyboardType(keyboardType)
.autocapitalization(autocapitalize ? .none : .sentences)
.autocapitalization(autocapitalize ? .sentences : .none)
.disableAutocorrection(!autocorrect)

View File

@ -84,15 +84,18 @@ final class ZECCWalletEnvironment: ObservableObject {
func createNewWallet() throws {
guard let randomPhrase = MnemonicSeedProvider.default.randomMnemonic(),
let randomSeed = MnemonicSeedProvider.default.toSeed(mnemonic: randomPhrase) else {
throw WalletError.createFailed
do {
let randomPhrase = try MnemonicSeedProvider.default.randomMnemonic()
let randomSeed = try MnemonicSeedProvider.default.toSeed(mnemonic: randomPhrase)
let birthday = WalletBirthday.birthday(with: BlockHeight.max)
try SeedManager.default.importSeed(randomSeed)
try SeedManager.default.importBirthday(birthday.height)
try SeedManager.default.importPhrase(bip39: randomPhrase)
try self.initialize()
} catch {
throw WalletError.createFailed(underlying: error)
}
let birthday = WalletBirthday.birthday(with: BlockHeight.max)
try SeedManager.default.importSeed(randomSeed)
try SeedManager.default.importBirthday(birthday.height)
try SeedManager.default.importPhrase(bip39: randomPhrase)
try self.initialize()
}
func initialize() throws {
@ -146,7 +149,7 @@ final class ZECCWalletEnvironment: ObservableObject {
case .dataDbNotEmpty:
return WalletError.initializationFailed(message: "attempt to initialize a db that was not empty")
case .saplingSpendParametersNotFound:
return WalletError.createFailed
return WalletError.createFailed(underlying: rustError)
case .malformedStringInput:
return WalletError.genericErrorWithError(error: rustError)
default:

View File

@ -9,7 +9,7 @@
import Foundation
enum WalletError: Error {
case createFailed
case createFailed(underlying: Error)
case initializationFailed(message: String)
case synchronizerFailed
case genericErrorWithMessage(message: String)

View File

@ -9,30 +9,31 @@
import Foundation
enum MnemonicError: Error {
case invalidSeed
case checksumFailed
}
protocol MnemonicSeedPhraseHandling {
/**
random 24 words mnemonic phrase
*/
func randomMnemonic() -> String?
func randomMnemonic() throws -> String
/**
random 24 words mnemonic phrase as array of words
*/
func randomMnemonicWords() -> [String]?
func randomMnemonicWords() throws -> [String]
/**
generate deterministic seed from mnemonic phrase
*/
func toSeed(mnemonic: String) -> [UInt8]?
func toSeed(mnemonic: String) throws -> [UInt8]
/**
get this mnemonic
*/
func asWords(mnemonic: String) -> [String]?
func asWords(mnemonic: String) throws -> [String]
/**
validates whether the given mnemonic is correct
*/
func isValid(mnemonic: String) -> Bool
func isValid(mnemonic: String) throws
}

View File

@ -14,24 +14,24 @@ class MnemonicSeedProvider: MnemonicSeedPhraseHandling {
private init(){}
func randomMnemonic() -> String? {
Mnemonic.generateMnemonic(strength: 256)
func randomMnemonic() throws -> String {
try Mnemonic.generateMnemonic(strength: 256)
}
func randomMnemonicWords() -> [String]? {
randomMnemonic()?.split(separator: " ").map({ String($0) })
func randomMnemonicWords() throws -> [String] {
try randomMnemonic().components(separatedBy: " ")
}
func toSeed(mnemonic: String) -> [UInt8]? {
guard let data = Mnemonic.deterministicSeedBytes(from: mnemonic) else { return nil }
func toSeed(mnemonic: String) throws -> [UInt8] {
let data = try Mnemonic.deterministicSeedBytes(from: mnemonic)
return [UInt8](data)
}
func asWords(mnemonic: String) -> [String]? {
mnemonic.split(separator: " ").map({ String($0) })
func asWords(mnemonic: String) throws -> [String] {
mnemonic.components(separatedBy: " ")
}
func isValid(mnemonic: String) -> Bool {
Mnemonic.validate(mnemonic: mnemonic)
func isValid(mnemonic: String) throws {
try Mnemonic.validate(mnemonic: mnemonic)
}
}

View File

@ -14,6 +14,7 @@ struct RestoreWallet: View {
@EnvironmentObject var appEnvironment: ZECCWalletEnvironment
@State var seedPhrase: String = ""
@State var walletBirthDay: String = ""
@State var showError = false
var isValidBirthday: Bool {
validateBirthday(walletBirthDay)
}
@ -36,7 +37,12 @@ struct RestoreWallet: View {
}
func validateSeed(_ seed: String) -> Bool {
MnemonicSeedProvider.default.isValid(mnemonic: seed)
do {
try MnemonicSeedProvider.default.isValid(mnemonic: seed)
return true
} catch {
return false
}
}
func importBirthday() throws {
@ -46,10 +52,13 @@ struct RestoreWallet: View {
func importSeed() throws {
let trimmedSeedPhrase = seedPhrase.trimmingCharacters(in: .whitespacesAndNewlines)
guard !trimmedSeedPhrase.isEmpty, let seedBytes =
MnemonicSeedProvider.default.toSeed(mnemonic: trimmedSeedPhrase) else { throw WalletError.createFailed
guard !trimmedSeedPhrase.isEmpty else {
throw WalletError.createFailed(underlying: MnemonicError.invalidSeed)
}
let seedBytes =
try MnemonicSeedProvider.default.toSeed(mnemonic: trimmedSeedPhrase)
try SeedManager.default.importSeed(seedBytes)
try SeedManager.default.importPhrase(bip39: trimmedSeedPhrase)
}
@ -59,6 +68,21 @@ struct RestoreWallet: View {
}
@State var proceed: Bool = false
var seedPhraseSubtitle: some View {
if seedPhrase.isEmpty {
return Text.subtitle(text: "Make sure nobody is watching you!".localized())
}
do {
try MnemonicSeedProvider.default.isValid(mnemonic: seedPhrase)
return Text.subtitle(text: "Your seed phrase is valid")
} catch {
return Text.subtitle(text: "Your seed phrase is invalid!")
.foregroundColor(.red)
.bold()
}
}
var body: some View {
ZStack {
NavigationLink(destination: LazyView(Home(amount: 0, verifiedBalance: self.appEnvironment.initializer.getBalance().asHumanReadableZecBalance()).environmentObject(self.appEnvironment)), isActive: $proceed) {
@ -67,19 +91,19 @@ struct RestoreWallet: View {
ZcashBackground()
VStack {
Spacer()
VStack(spacing: 40) {
ZcashTextField(
title: "Enter your Seed Phrase".localized(),
subtitleView: AnyView(
Text.subtitle(text: "Make sure nobody is watching you!".localized())
seedPhraseSubtitle
),
keyboardType: UIKeyboardType.alphabet,
binding: $seedPhrase,
onEditingChanged: { _ in },
onCommit: {}
)
Spacer()
ZcashTextField(
title: "Wallet Birthday height".localized(),
subtitleView: AnyView(
@ -98,6 +122,8 @@ struct RestoreWallet: View {
try self.appEnvironment.initialize()
} catch {
logger.error("\(error)")
tracker.track(.error(severity: .critical), properties: [
ErrorSeverity.underlyingError : "\(error)"])
return
}
tracker.track(.tap(action: .walletImport), properties: [:])
@ -111,10 +137,15 @@ struct RestoreWallet: View {
.opacity(disableProceed ? 0.4 : 1.0)
.frame(height: 58)
}
.padding([.horizontal,.bottom], 30)
.padding([.horizontal,.top, .bottom], 30)
}.onTapGesture {
UIApplication.shared.endEditing()
}
.alert(isPresented: $showError) {
Alert(title: Text("Could not restore wallet"),
message: Text("There's a problem restoring your wallet. Please verify your seed phrase and try again."),
dismissButton: .default(Text("Dismiss")))
}
.onAppear {
tracker.track(.screen(screen: .restore), properties: [:])
}

View File

@ -5,13 +5,15 @@
// Created by Francisco Gindre on 12/30/19.
// Copyright © 2019 Francisco Gindre. All rights reserved.
//
import SwiftUI
struct SeedBackup: View {
let buttonPadding: CGFloat = 40
let buttonHeight: CGFloat = 58
var hideNavBar = true
@State var error: WalletError?
@State var showError = false
@State var copyItemModel: PasteboardItemModel?
@State var proceedsToHome = false
@EnvironmentObject var appEnvironment: ZECCWalletEnvironment
@ -46,10 +48,9 @@ struct SeedBackup: View {
let seedPhrase = try SeedManager.default.exportPhrase()
guard MnemonicSeedProvider.default.isValid(mnemonic: seedPhrase),
let words = MnemonicSeedProvider.default.asWords(mnemonic: seedPhrase) else {
throw MnemonicError.invalidSeed
}
try MnemonicSeedProvider.default.isValid(mnemonic: seedPhrase)
let words = try MnemonicSeedProvider.default.asWords(mnemonic: seedPhrase)
return AnyView(
ZcashSeedPhraseGrid(words: words)
@ -62,6 +63,7 @@ struct SeedBackup: View {
ErrorSeverity.messageKey : message,
ErrorSeverity.underlyingError : "\(error)"
])
self.showError = true
}
return AnyView(EmptyView())
}
@ -113,6 +115,11 @@ struct SeedBackup: View {
PasteboardAlertHelper.alert(for: p)
}
}
.alert(isPresented: self.$showError) {
Alert(title: Text("Problem Retrieving your seed"),
message: Text("we are unable to display your seed phrase. close the app and retry this operation"),
dismissButton: .default(Text("Dismiss")))
}
.onAppear {
tracker.track(.screen(screen: .backup), properties: [:])
}

View File

@ -83,6 +83,8 @@
"If you don't know it, leave it blank. First Sync will take longer." = "If you don't know it, leave it blank. First Sync will take longer.";
"Proceed" = "Proceed";
"Restore from Seed Phrase" = "Restore from Seed Phrase";
"Your seed phrase is valid" = "Your seed phrase is valid";
"Your seed phrase is invalid!" = "Your seed phrase is invalid!";
//BackupWallet
"Your Wallet needs\nto be Backed up" = "Your Wallet needs\nto be Backed up";

View File

@ -96,6 +96,8 @@
"If you don't know it, leave it blank. First Sync will take longer." = "Si no lo sabe, déjelo en blanco. La primera sincronización llevará más tiempo.";
"Proceed" = "Continuar";
"Restore from Seed Phrase" = "Restaurar desde frase semilla";
"Your seed phrase is valid" = "Tu frase semilla es válida";
"Your seed phrase is invalid!" = "¡Tu frase semilla es inválida!";
//BackupWallet
"Your Wallet needs\nto be Backed up" = "Su wallet necesita \n ser respaldada";

View File

@ -7,7 +7,7 @@
//
import XCTest
@testable import ECC_Wallet
@testable import ECC_Wallet_no_logs
class DetailCardTests: XCTestCase {
@ -23,7 +23,7 @@ class DetailCardTests: XCTestCase {
XCTAssertEqual(DetailModel.subtitle(isPending: true, isSubmitSuccess: true, minedHeight: -1, date: date, latestBlockHeight: latestHeight), "Pending confirmation".localized())
// transaction submitted, mined with height
XCTAssertEqual(DetailModel.subtitle(isPending: true, isSubmitSuccess: true, minedHeight: minedHeight, date: date, latestBlockHeight: latestHeight), "Confirmations".localized(with: abs(latestHeight - minedHeight)))
XCTAssertEqual(DetailModel.subtitle(isPending: true, isSubmitSuccess: true, minedHeight: minedHeight, date: date, latestBlockHeight: latestHeight), "2 of 10 Confirmations")
// submitted, mined but no info on current latestheight
XCTAssertEqual(DetailModel.subtitle(isPending: true, isSubmitSuccess: true, minedHeight: minedHeight, date: date, latestBlockHeight: -1), "Pending confirmation".localized())

View File

@ -8,7 +8,7 @@
import XCTest
import Combine
@testable import ECC_Wallet
@testable import ECC_Wallet_no_logs
class KeyPadViewModelTests: XCTestCase {

View File

@ -8,7 +8,7 @@
import Foundation
import XCTest
@testable import ECC_Wallet
@testable import ECC_Wallet_no_logs
class NumberTests: XCTestCase {

View File

@ -7,7 +7,7 @@
//
import XCTest
@testable import ECC_Wallet
@testable import ECC_Wallet_no_logs
class UILogicTests: XCTestCase {

View File

@ -7,7 +7,7 @@
//
import XCTest
@testable import ECC_Wallet
@testable import ECC_Wallet_no_logs
import MnemonicSwift
@testable import ZcashLightClientKit
class walletTests: XCTestCase {
@ -20,13 +20,6 @@ class walletTests: XCTestCase {
// Put teardown code here. This method is called after the invocation of each test method in the class.
}
func testZaddressValidator() {
let zAddresss = "Ztestsapling1ctuamfer5xjnnrdr3xdazenljx0mu0gutcf9u9e74tr2d3jwjnt0qllzxaplu54hgc2tyjdc2p6"
let expected = "Ztestsap...tyjdc2p6"
XCTAssertEqual(zAddresss.shortZaddress, expected)
XCTAssertNil("testsapling1ctuamfer5xjnnrdr3xdazenljx0mu0gutcf9u9e74tr2d3jwjnt0qllzxaplu54hgc2tyjdc2p6".shortZaddress)
}
func testReplyToMemo() {
let memo = "Happy Birthday! Have fun spending these ZEC! visit https://paywithz.cash to know all the places that take ZEC payments!"
@ -82,40 +75,38 @@ class walletTests: XCTestCase {
}
func testMnemonics() {
func testMnemonics() throws {
guard let phrase = Mnemonic.generateMnemonic(strength: 256) else {
XCTFail()
return
}
let phrase = try Mnemonic.generateMnemonic(strength: 256)
XCTAssertTrue(phrase.split(separator: " ").count == 24)
XCTAssertNotNil(Mnemonic.deterministicSeedString(from: phrase),"could not generate seed from phrase: \(phrase)")
XCTAssertNotNil(try Mnemonic.deterministicSeedString(from: phrase),"could not generate seed from phrase: \(phrase)")
}
func testRestore() {
func testRestore() throws {
let expectedSeed = "715b4b7950c2153e818f88122f8e54a00e36c42e47ba9589dc82fcecfc5b7ec7d06f4e3a3363a0221e06f14f52e03294290139d05d293059a55076b7f37d6726"
let phrase = "abuse fee wage robot october tongue utility gloom dizzy best victory armor second share pilot help cotton mango music decorate scheme mix tell never"
XCTAssertEqual(MnemonicSeedProvider.default.toSeed(mnemonic: phrase)?.hexString,expectedSeed)
XCTAssertEqual(try MnemonicSeedProvider.default.toSeed(mnemonic: phrase).hexString,expectedSeed)
}
func testRestoreZaddress() {
func testRestoreZaddress() throws {
ZECCWalletEnvironment.shared.nuke()
let phrase = "human pulse approve subway climb stairs mind gentle raccoon warfare fog roast sponsor under absorb spirit hurdle animal original honey owner upper empower describe"
let expectedAddress = "zs1gn2ah0zqhsxnrqwuvwmgxpl5h3ha033qexhsz8tems53fw877f4gug353eefd6z8z3n4zxty65c"
let seed = MnemonicSeedProvider.default.toSeed(mnemonic: phrase)
let seed = try MnemonicSeedProvider.default.toSeed(mnemonic: phrase)
let hex = "f4e3d38d9c244da7d0407e19a93c80429614ee82dcf62c141235751c9f1228905d12a1f275f5c22f6fb7fcd9e0a97f1676e0eec53fdeeeafe8ce8aa39639b9fe"
XCTAssertEqual(seed?.hexString, hex)
XCTAssertEqual(seed.hexString, hex)
try! SeedManager.default.importSeed(seed!)
try! SeedManager.default.importSeed(seed)
try! SeedManager.default.importPhrase(bip39: phrase)
let accounts = try! ZECCWalletEnvironment.shared.initializer.initialize(seedProvider: SeedManager.default, walletBirthdayHeight: 692345)
@ -137,12 +128,12 @@ class walletTests: XCTestCase {
XCTAssert(split.count == 8)
}
func testCompatibility() {
func testCompatibility() throws {
let words = "human pulse approve subway climb stairs mind gentle raccoon warfare fog roast sponsor under absorb spirit hurdle animal original honey owner upper empower describe"
let hex = "f4e3d38d9c244da7d0407e19a93c80429614ee82dcf62c141235751c9f1228905d12a1f275f5c22f6fb7fcd9e0a97f1676e0eec53fdeeeafe8ce8aa39639b9fe"
XCTAssertTrue(MnemonicSeedProvider.default.isValid(mnemonic: words))
XCTAssertEqual(MnemonicSeedProvider.default.toSeed(mnemonic: words)?.hexString, hex)
XCTAssertNoThrow(try MnemonicSeedProvider.default.isValid(mnemonic: words))
XCTAssertEqual(try MnemonicSeedProvider.default.toSeed(mnemonic: words).hexString, hex)
}
func testAlmostIncludesReplyTo() {

View File

@ -9,13 +9,13 @@
import XCTest
class walletUITests: XCTestCase {
override func setUp() {
// Put setup code here. This method is called before the invocation of each test method in the class.
// In UI tests it is usually best to stop immediately when a failure occurs.
continueAfterFailure = false
// In UI tests its important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this.
}
@ -25,11 +25,46 @@ class walletUITests: XCTestCase {
func testExample() {
// UI tests must launch the application that they test.
let app = XCUIApplication()
app.launch()
// Use recording to get started writing UI tests.
// Use XCTAssert and related functions to verify your tests produce the correct results.
}
func testSeedRestore() {
// UI tests must launch the application that they test.
let app = XCUIApplication()
app.launch()
app.buttons["Restore"].tap()
XCTAssertNotNil(app.staticTexts.allElementsBoundByIndex.first(where: {$0.label == "Make sure nobody is watching you!"}))
let seedPhraseTextfield = app.textFields.firstMatch
seedPhraseTextfield.tap()
seedPhraseTextfield.typeText("human pulse approve subway climb stairs mind gentle raccoon warfare fog roast sponsor under absorb spirit hurdle animal original honey owner upper empower describe")
XCTAssertNotNil(app.staticTexts.allElementsBoundByIndex.first(where: { (element) -> Bool in
element.label == "Your seed phrase is valid"
}))
guard let proceedButton = app.buttons.allElementsBoundByIndex.first(where: { $0.label == "Proceed" }) else {
XCTFail("Proceed button not found")
return
}
XCTAssertTrue(proceedButton.isEnabled)
seedPhraseTextfield.typeText("")
seedPhraseTextfield.clearAndEnterText(text: "Human pulse approve subway climb stairs mind gentle raccoon warfare fog roast sponsor under absorb spirit hurdle animal original honey owner upper empower describe")
XCTAssertNotNil(app.staticTexts.allElementsBoundByIndex.first(where: { (element) -> Bool in
element.label == "Your seed phrase is invalid!"
}))
app.tap()
guard let disabledProceedButton = app.buttons.allElementsBoundByIndex.first(where: { $0.label == "Proceed" }) else {
XCTFail("Proceed button not found")
return
}
XCTAssertFalse(disabledProceedButton.isEnabled)
}
func testLaunchPerformance() {
@ -41,3 +76,23 @@ class walletUITests: XCTestCase {
}
}
}
extension XCUIElement {
/**
Removes any current text in the field before typing in the new value
- Parameter text: the text to enter into the field
*/
func clearAndEnterText(text: String) {
guard let stringValue = self.value as? String else {
XCTFail("Tried to clear and enter text into a non string value")
return
}
self.tap()
let deleteString = String(repeating: XCUIKeyboardKey.delete.rawValue, count: stringValue.count)
self.typeText(deleteString)
self.typeText(text)
}
}