Skip to content

Commit

Permalink
Merge pull request #909 from WalletConnect/bugfix/cocoapods-sync
Browse files Browse the repository at this point in the history
[Cocoapods] Sync API support
  • Loading branch information
llbartekll authored Jun 14, 2023
2 parents bc2ec69 + 88bc9af commit 3894cc1
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 25 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ jobs:

- name: Lint CocoaPods
run: |
pod lib lint WalletConnectSwiftV2.podspec --verbose --allow-warnings
pod lib lint --verbose --no-clean --quick --allow-warnings --platforms=ios WalletConnectSwiftV2.podspec
2 changes: 1 addition & 1 deletion Sources/Chat/Storage/ChatStorage.swift
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ final class ChatStorage {
}

func getReceivedInvites(account: Account) -> [ReceivedInvite] {
return receivedInviteStore.getAll(for: account.absoluteString) ?? []
return receivedInviteStore.getAll(for: account.absoluteString)
}

func syncRejectedReceivedInviteStatus(id: Int64, account: Account) async throws {
Expand Down
19 changes: 0 additions & 19 deletions Sources/WalletConnectKMS/Keychain/GenericPasswordConvertible.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,3 @@ public protocol GenericPasswordConvertible {
init<D>(rawRepresentation data: D) throws where D: ContiguousBytes
var rawRepresentation: Data { get }
}

extension String: GenericPasswordConvertible {

enum Errors: Error {
case notUTF8
}

public init<D>(rawRepresentation data: D) throws where D: ContiguousBytes {
let buffer = data.withUnsafeBytes { Data($0) }
guard let string = String(data: buffer, encoding: .utf8) else {
throw Errors.notUTF8
}
self = string
}

public var rawRepresentation: Data {
return data(using: .utf8) ?? Data()
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import Foundation

extension String: GenericPasswordConvertible {

public init<D>(rawRepresentation data: D) throws where D: ContiguousBytes {
let buffer = data.withUnsafeBytes { Data($0) }
guard let string = String(data: buffer, encoding: .utf8) else {
throw Errors.notUTF8
}
self = string
}

public var rawRepresentation: Data {
return data(using: .utf8) ?? Data()
}
}

fileprivate enum Errors: Error {
case notUTF8
}
8 changes: 4 additions & 4 deletions Sources/WalletConnectUtils/Extensions/String.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@ import Foundation

public extension String {

enum Errors: Error {
case notAnURL
}

func toHexEncodedString(uppercase: Bool = true, prefix: String = "", separator: String = "") -> String {
return unicodeScalars.map { prefix + .init($0.value, radix: 16, uppercase: uppercase) } .joined(separator: separator)
}
Expand All @@ -20,3 +16,7 @@ public extension String {
return url
}
}

fileprivate enum Errors: Error {
case notAnURL
}

0 comments on commit 3894cc1

Please sign in to comment.