Skip to content

Commit

Permalink
Merge pull request #108 from OpenZesame/updating_version
Browse files Browse the repository at this point in the history
Release candidat 1.0.2
  • Loading branch information
Sajjon authored Jun 21, 2019
2 parents 6d4ce27 + 6685d3d commit 01c9e13
Show file tree
Hide file tree
Showing 13 changed files with 16 additions and 219 deletions.
2 changes: 1 addition & 1 deletion Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
19 changes: 5 additions & 14 deletions Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
24 changes: 0 additions & 24 deletions Pods/Local Podspecs/BigInt.podspec.json

This file was deleted.

36 changes: 0 additions & 36 deletions Pods/Local Podspecs/CryptoSwift.podspec.json

This file was deleted.

43 changes: 0 additions & 43 deletions Pods/Local Podspecs/Zesame.podspec.json

This file was deleted.

19 changes: 5 additions & 14 deletions Pods/Manifest.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion Pods/Zesame/Source/Models/Manual/Payment/Payment.swift

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions Source/Application/AppCoordinator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,7 @@ enum AmountError<ConvertTo: ExpressibleByAmount>: 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?
}
}
}
2 changes: 1 addition & 1 deletion Source/Application/Zhip-Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0.1</string>
<string>1.0.2</string>
<key>CFBundleVersion</key>
<string>15</string>
<key>ITSAppUsesNonExemptEncryption</key>
Expand Down
5 changes: 0 additions & 5 deletions Source/Scenes/1_Main/2_Main/0_Main/Main.swift
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,3 @@ extension Main: NavigationBarLayoutOwner {
return .transluscent
}
}



//final class AppLocked: Scene<AppLockedView> {}
//final class AppLockedView: UIView {}
Original file line number Diff line number Diff line change
Expand Up @@ -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
]
Expand Down
77 changes: 3 additions & 74 deletions Tests/Tests/CharacterSetTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 01c9e13

Please sign in to comment.