From 3886c3902571a434d480a24279a6d1fcb4e4db81 Mon Sep 17 00:00:00 2001 From: Alexander Cyon Date: Fri, 21 Jun 2019 13:26:49 +0200 Subject: [PATCH 1/3] bumping app version to 1.0.2 --- Source/Application/Zhip-Info.plist | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Application/Zhip-Info.plist b/Source/Application/Zhip-Info.plist index 082ee543..752cac63 100644 --- a/Source/Application/Zhip-Info.plist +++ b/Source/Application/Zhip-Info.plist @@ -15,7 +15,7 @@ CFBundlePackageType APPL CFBundleShortVersionString - 1.0.1 + 1.0.2 CFBundleVersion 15 ITSAppUsesNonExemptEncryption From 01c00c40b20701dbe35e9d15fde1df1c9632310b Mon Sep 17 00:00:00 2001 From: Alexander Cyon Date: Fri, 21 Jun 2019 13:27:29 +0200 Subject: [PATCH 2/3] updating to Zesame released tag 1.0.1 instead of using git branch (no change in the Zesame code). --- Podfile | 2 +- Podfile.lock | 19 +++----- Pods/Local Podspecs/BigInt.podspec.json | 24 ----------- Pods/Local Podspecs/CryptoSwift.podspec.json | 36 ---------------- Pods/Local Podspecs/Zesame.podspec.json | 43 ------------------- Pods/Manifest.lock | 19 +++----- .../Models/Manual/Payment/Payment.swift | 1 - Source/Application/AppCoordinator.swift | 3 -- 8 files changed, 11 insertions(+), 136 deletions(-) delete mode 100644 Pods/Local Podspecs/BigInt.podspec.json delete mode 100644 Pods/Local Podspecs/CryptoSwift.podspec.json delete mode 100644 Pods/Local Podspecs/Zesame.podspec.json diff --git a/Podfile b/Podfile index d43a30e3..1a31285d 100644 --- a/Podfile +++ b/Podfile @@ -4,7 +4,7 @@ use_modular_headers! def shared # The Zilliqa Swift SDK - pod 'Zesame', :git => 'https://github.com/OpenZesame/Zesame.git', :branch => 'decimal_amount' + pod 'Zesame', '~> 1.0.1' # Used for Crash reporting pod 'Firebase/Core' diff --git a/Podfile.lock b/Podfile.lock index 31a0ab56..344aae39 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -87,7 +87,7 @@ PODS: - SwiftyBeaver (1.6.2) - TinyConstraints (3.3.1) - Validator (3.1.1) - - Zesame (1.0.0): + - Zesame (1.0.1): - Alamofire (~> 5.0.0-beta.4) - BigInt (~> 4.0.0) - CryptoSwift (~> 1.0.0) @@ -116,7 +116,7 @@ DEPENDENCIES: - SwiftyBeaver - TinyConstraints - Validator - - Zesame (from `https://github.com/OpenZesame/Zesame.git`, branch `decimal_amount`) + - Zesame (~> 1.0.1) SPEC REPOS: https://github.com/cocoapods/specs.git: @@ -154,16 +154,7 @@ SPEC REPOS: - SwiftyBeaver - TinyConstraints - Validator - -EXTERNAL SOURCES: - Zesame: - :branch: decimal_amount - :git: https://github.com/OpenZesame/Zesame.git - -CHECKOUT OPTIONS: - Zesame: - :commit: 8da70b2c224da9d186867cf462078b5603f1d21c - :git: https://github.com/OpenZesame/Zesame.git + - Zesame SPEC CHECKSUMS: Alamofire: cd08a4402bd12cacd0c66f23fb12fec8d6b965e4 @@ -200,8 +191,8 @@ SPEC CHECKSUMS: SwiftyBeaver: 8e67ab3cd94389cbbb7a9c7cc02748d98bfee68e TinyConstraints: dbf7519aefc01ea59d62244300c7718aec68e280 Validator: b34ab17a8fffd0c1ffd8f9002ead4d1e02cd9e6e - Zesame: c7bbd6548ef648af5480338f37a94bd4fe0bc4e3 + Zesame: 33728cc171403a8f48c08985ce8375bae9d8faba -PODFILE CHECKSUM: 1fe225be0adb22d399a61c5e12f3713681222bb3 +PODFILE CHECKSUM: c1b20b1e99cdedab5a61d43b103b44a947a887ec COCOAPODS: 1.6.1 diff --git a/Pods/Local Podspecs/BigInt.podspec.json b/Pods/Local Podspecs/BigInt.podspec.json deleted file mode 100644 index 725b8c9e..00000000 --- a/Pods/Local Podspecs/BigInt.podspec.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "name": "BigInt", - "version": "4.0.0", - "platforms": { - "ios": "8.0", - "osx": "10.9", - "tvos": "9.0", - "watchos": "2.0" - }, - "license": { - "type": "MIT", - "file": "LICENSE.md" - }, - "summary": "Arbitrary-precision arithmetic in pure Swift", - "homepage": "https://github.com/attaswift/BigInt", - "authors": "Károly Lőrentey", - "source": { - "git": "https://github.com/attaswift/BigInt.git", - "tag": "v4.0.0" - }, - "source_files": "sources/*.swift", - "social_media_url": "https://twitter.com/lorentey", - "documentation_url": "http://attaswift.github.io/BigInt/" -} diff --git a/Pods/Local Podspecs/CryptoSwift.podspec.json b/Pods/Local Podspecs/CryptoSwift.podspec.json deleted file mode 100644 index 91dda7fa..00000000 --- a/Pods/Local Podspecs/CryptoSwift.podspec.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "name": "CryptoSwift", - "version": "1.0.0", - "source": { - "git": "https://github.com/krzyzanowskim/CryptoSwift.git", - "tag": "1.0.0" - }, - "summary": "Cryptography in Swift. SHA, MD5, CRC, PBKDF, Poly1305, HMAC, CMAC, HDKF, ChaCha20, Rabbit, Blowfish, AES.", - "description": "Cryptography functions and helpers for Swift implemented in Swift. SHA-1, SHA-2, SHA-3, MD5, PBKDF1, PBKDF2, scrypt, CRC, Poly1305, HMAC, ChaCha20, Rabbit, Blowfish, AES", - "homepage": "https://github.com/krzyzanowskim/CryptoSwift", - "license": { - "type": "Attribution", - "file": "LICENSE" - }, - "authors": { - "Marcin Krzyżanowski": "marcin@krzyzanowskim.com" - }, - "social_media_url": "https://twitter.com/krzyzanowskim", - "cocoapods_version": ">= 1.4.0", - "swift_version": "4.2", - "platforms": { - "ios": "8.0", - "osx": "10.10", - "watchos": "2.0", - "tvos": "9.0" - }, - "source_files": "Sources/CryptoSwift/**/*.swift", - "requires_arc": true, - "pod_target_xcconfig": { - "SWIFT_OPTIMIZATION_LEVEL": "-O", - "SWIFT_COMPILATION_MODE": "wholemodule", - "SWIFT_DISABLE_SAFETY_CHECKS": "YES", - "SWIFT_ENFORCE_EXCLUSIVE_ACCESS": "debug-only", - "GCC_UNROLL_LOOPS": "YES" - } -} diff --git a/Pods/Local Podspecs/Zesame.podspec.json b/Pods/Local Podspecs/Zesame.podspec.json deleted file mode 100644 index aa0a4aa0..00000000 --- a/Pods/Local Podspecs/Zesame.podspec.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "name": "Zesame", - "version": "1.0.0", - "swift_version": "5.0", - "platforms": { - "ios": "11.3" - }, - "license": { - "type": "MIT", - "file": "LICENSE" - }, - "summary": "Zilliqa SDK in pure Swift", - "homepage": "https://github.com/OpenZesame/Zesame", - "authors": { - "Alex Cyon": "alex.cyon@gmail.com" - }, - "source": { - "git": "https://github.com/OpenZesame/Zesame.git", - "tag": "1.0.0" - }, - "source_files": "Source/**/*.swift", - "social_media_url": "https://twitter.com/alexcyon", - "dependencies": { - "EllipticCurveKit": [ - "~> 1.0.0" - ], - "BigInt": [ - "~> 4.0.0" - ], - "CryptoSwift": [ - "~> 1.0.0" - ], - "RxSwift": [ - "~> 4.5.0" - ], - "SwiftProtobuf": [ - "~> 1.5.0" - ], - "Alamofire": [ - "~> 5.0.0-beta.4" - ] - } -} diff --git a/Pods/Manifest.lock b/Pods/Manifest.lock index 31a0ab56..344aae39 100644 --- a/Pods/Manifest.lock +++ b/Pods/Manifest.lock @@ -87,7 +87,7 @@ PODS: - SwiftyBeaver (1.6.2) - TinyConstraints (3.3.1) - Validator (3.1.1) - - Zesame (1.0.0): + - Zesame (1.0.1): - Alamofire (~> 5.0.0-beta.4) - BigInt (~> 4.0.0) - CryptoSwift (~> 1.0.0) @@ -116,7 +116,7 @@ DEPENDENCIES: - SwiftyBeaver - TinyConstraints - Validator - - Zesame (from `https://github.com/OpenZesame/Zesame.git`, branch `decimal_amount`) + - Zesame (~> 1.0.1) SPEC REPOS: https://github.com/cocoapods/specs.git: @@ -154,16 +154,7 @@ SPEC REPOS: - SwiftyBeaver - TinyConstraints - Validator - -EXTERNAL SOURCES: - Zesame: - :branch: decimal_amount - :git: https://github.com/OpenZesame/Zesame.git - -CHECKOUT OPTIONS: - Zesame: - :commit: 8da70b2c224da9d186867cf462078b5603f1d21c - :git: https://github.com/OpenZesame/Zesame.git + - Zesame SPEC CHECKSUMS: Alamofire: cd08a4402bd12cacd0c66f23fb12fec8d6b965e4 @@ -200,8 +191,8 @@ SPEC CHECKSUMS: SwiftyBeaver: 8e67ab3cd94389cbbb7a9c7cc02748d98bfee68e TinyConstraints: dbf7519aefc01ea59d62244300c7718aec68e280 Validator: b34ab17a8fffd0c1ffd8f9002ead4d1e02cd9e6e - Zesame: c7bbd6548ef648af5480338f37a94bd4fe0bc4e3 + Zesame: 33728cc171403a8f48c08985ce8375bae9d8faba -PODFILE CHECKSUM: 1fe225be0adb22d399a61c5e12f3713681222bb3 +PODFILE CHECKSUM: c1b20b1e99cdedab5a61d43b103b44a947a887ec COCOAPODS: 1.6.1 diff --git a/Pods/Zesame/Source/Models/Manual/Payment/Payment.swift b/Pods/Zesame/Source/Models/Manual/Payment/Payment.swift index c3e24330..72ad8cfe 100644 --- a/Pods/Zesame/Source/Models/Manual/Payment/Payment.swift +++ b/Pods/Zesame/Source/Models/Manual/Payment/Payment.swift @@ -47,7 +47,6 @@ public struct Payment { } public extension Payment { - static func estimatedTotalTransactionFee(gasPrice: GasPrice, gasLimit: GasLimit = .defaultGasLimit) throws -> Qa { return Qa(qa: Qa.Magnitude(gasLimit) * gasPrice.qa) } diff --git a/Source/Application/AppCoordinator.swift b/Source/Application/AppCoordinator.swift index 489c78a9..07947a35 100644 --- a/Source/Application/AppCoordinator.swift +++ b/Source/Application/AppCoordinator.swift @@ -160,9 +160,7 @@ extension AppCoordinator { private extension AppCoordinator { func lockApp() { - print("🔐 Trying to lock app") if isCurrentlyPresentingUnLockScene || isCurrentlyPresentingLockScene { - print("🙅🏻‍♀️ Avoided locking app 🔒") return } deepLinkHandler.appIsLockedBufferDeeplinks() @@ -172,7 +170,6 @@ private extension AppCoordinator { func unlockApp() { if isCurrentlyPresentingUnLockScene { return } guard isCurrentlyPresentingLockScene else { return } - print("🔓 Trying to unlock app") if hasConfiguredPincode { toUnlockAppWithPincodeIfNeeded() } else { From 6685d3d4708dd8e447ee3a4d992e9201b4ea5e52 Mon Sep 17 00:00:00 2001 From: Alexander Cyon Date: Fri, 21 Jun 2019 13:33:35 +0200 Subject: [PATCH 3/3] cleaning up --- .../Validators/AmountValidator.swift | 3 +- Source/Scenes/1_Main/2_Main/0_Main/Main.swift | 5 -- .../B_Receive/Receive/ReceiveView.swift | 1 - Tests/Tests/CharacterSetTests.swift | 77 +------------------ 4 files changed, 4 insertions(+), 82 deletions(-) diff --git a/Source/Application/InputValidators/Validators/AmountValidator.swift b/Source/Application/InputValidators/Validators/AmountValidator.swift index cf607f0e..dfe8898f 100644 --- a/Source/Application/InputValidators/Validators/AmountValidator.swift +++ b/Source/Application/InputValidators/Validators/AmountValidator.swift @@ -88,8 +88,7 @@ enum AmountError: Swift.Error, InputError { case .tooLarge(let max, let unit): return €.tooLarge("\(max.thousands) \(unit.name)") case .tooSmall(let min, let unit): return €.tooSmall("\(min.thousands) \(unit.name)") case .nonNumericString: return €.nonNumericString - case .other(let anyError): - return €.nonNumericString // TODO which error message to display? + case .other: return €.nonNumericString // TODO which error message to display? } } } diff --git a/Source/Scenes/1_Main/2_Main/0_Main/Main.swift b/Source/Scenes/1_Main/2_Main/0_Main/Main.swift index a331c98e..917044c2 100644 --- a/Source/Scenes/1_Main/2_Main/0_Main/Main.swift +++ b/Source/Scenes/1_Main/2_Main/0_Main/Main.swift @@ -35,8 +35,3 @@ extension Main: NavigationBarLayoutOwner { return .transluscent } } - - - -//final class AppLocked: Scene {} -//final class AppLockedView: UIView {} diff --git a/Source/Scenes/1_Main/2_Main/B_Receive/Receive/ReceiveView.swift b/Source/Scenes/1_Main/2_Main/B_Receive/Receive/ReceiveView.swift index 0419f373..09b16168 100644 --- a/Source/Scenes/1_Main/2_Main/B_Receive/Receive/ReceiveView.swift +++ b/Source/Scenes/1_Main/2_Main/B_Receive/Receive/ReceiveView.swift @@ -61,7 +61,6 @@ extension ReceiveView: ViewModelled { return [ viewModel.receivingAddress --> addressValueTextView.rx.text, viewModel.amountPlaceholder --> requestingAmountField.rx.placeholder, -// viewModel.amount --> requestingAmountField.rx.text, viewModel.amountValidation --> requestingAmountField.rx.validation, viewModel.qrImage --> qrImageView.rx.image ] diff --git a/Tests/Tests/CharacterSetTests.swift b/Tests/Tests/CharacterSetTests.swift index 831b7862..0903e686 100644 --- a/Tests/Tests/CharacterSetTests.swift +++ b/Tests/Tests/CharacterSetTests.swift @@ -46,85 +46,14 @@ class CharacterSetTests: XCTestCase { } - private func doTest(_ amountString: String, expected: Double) { - - func doubleFromAnyLocale(numberString: String) -> Double? { - func tryLocale(locale: Locale) -> Double? { - let formatter = NumberFormatter() - formatter.locale = locale - return formatter.number(from: amountString)?.doubleValue - } - - for localeIdentifier in Locale.availableIdentifiers { - let locale = Locale(identifier: localeIdentifier) - if let double = tryLocale(locale: locale) { - print("Successfully created number from locale with id: \(localeIdentifier)") - return double - } else { - print("Failed to create number from locale with id: \(localeIdentifier)") - } - } - return nil - } - guard let number = doubleFromAnyLocale(numberString: amountString) else { - return XCTFail("failed to get number from: `\(amountString)`") - } - XCTAssertEqual(number, expected) - } - - func testFo() { - doTest("0,1", expected: 0.1) - doTest("0.1", expected: 0.1) - } - - func testZilAmountFromDecimalStringWithDot() { - XCTAssertNotNil(Double("0.01")) -// XCTAssertNoThrow(try ZilAmount.init(zil: "0.01")) - } - func testZilAmountFromDecimalStringWithComma() { - XCTAssertNotNil(Double("0,01")) -// XCTAssertNoThrow(try ZilAmount.init(zil: "0,01")) + XCTAssertNotNil(Double("0\(decSep)01")) } - - func testCurrntLocaleIsSweden() { - XCTAssertEqual(Locale.current.identifier, "en_US") - } - - func testAmountFromStringLocale() { - XCTAssertEqual(Locale.current.identifier, "en_US") - XCTAssertNotNil(Locale(identifier: "sv_SE")) - -// let languages = ["bs", "zh-Hant", "en", "fi", "ko", "lv", "ms", "pl", "pt-BR", "ru", "sr-Latn", "sk", "es", "tr"] -// UserDefaults.standard.set([languages[0]], forKey: "AppleLanguages") - - func assertLanguages(equal: [String]) { - if let anyLang = UserDefaults.standard.value(forKey: .languagesKey) { - if let languages = anyLang as? [String] { - XCTAssertEqual(languages.count, equal.count) - XCTAssertEqual(languages, equal) - - } else { - XCTFail("not a string array") - } - } else { - XCTFail("nu value for key `AppleLanguages`") - } - } - - assertLanguages(equal: ["en-SE"]) -// UserDefaults.standard.set(["en-SE"], forKey: .languagesKey) -// assertLanguages(equal: ["sv-SE"]) -// XCTAssertEqual(Locale.current.identifier, "sv-SE") - -// let swedish = Locale(identifier: "sv_SE") -// Locale.current = swedish - -// try Amount(zil: amountString) - } } private extension String { static let languagesKey = "AppleLanguages" } + +private let decSep = Locale.current.decimalSeparatorForSure