Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
jszersze committed Jun 7, 2024
1 parent 2f4ecf9 commit 490155f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions Sources/WalletSdk/KeyManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ public class KeyManager: NSObject {
*/
static func reset() -> Bool {
let query: [String: Any] = [
kSecClass as String: kSecClassKey,
kSecClass as String: kSecClassKey
]

let ret = SecItemDelete(query as CFDictionary)
Expand Down Expand Up @@ -80,7 +80,7 @@ public class KeyManager: NSObject {

var error: Unmanaged<CFError>?
SecKeyCreateRandomKey(attributes as CFDictionary, &error)
if (error != nil) { print(error!) }
if error != nil { print(error!) }
return error == nil
}

Expand Down Expand Up @@ -170,7 +170,7 @@ public class KeyManager: NSObject {

var error: Unmanaged<CFError>?
SecKeyCreateRandomKey(attributes as CFDictionary, &error)
if (error != nil) { print(error ?? "no error") }
if error != nil { print(error ?? "no error") }
return error == nil
}

Expand Down
6 changes: 3 additions & 3 deletions Tests/WalletSdkTests/DataConversions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import XCTest
@testable import SpruceIDWalletSdk

final class DataConversions: XCTestCase {

/**
* Tests to see if the base 64 url encoding correctly converts the sample data and
* replaces special characters.
Expand All @@ -18,10 +18,10 @@ final class DataConversions: XCTestCase {
let staticString = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=+ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/="
let sampleData: Data = staticString.data(using: .utf8)!
let base64 = sampleData.base64EncodedUrlSafe

// Generated independently
let expectedBase64String = "QUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVowMTIzNDU2Nzg5Ky89K0FCQ0RFRkdISUpLTE1OT1BRUlNUVVZXWFlaMDEyMzQ1Njc4OSsvPQ"

XCTAssertEqual(base64, expectedBase64String)
}
}

0 comments on commit 490155f

Please sign in to comment.