Skip to content

Commit

Permalink
Merge pull request #13 from reown-com/develop
Browse files Browse the repository at this point in the history
1.0.1
  • Loading branch information
llbartekll authored Sep 17, 2024
2 parents 64c4a24 + 6aab7d5 commit 3aa7e34
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 9 deletions.
7 changes: 1 addition & 6 deletions Sources/WalletConnectRelay/Dispatching.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ protocol Dispatching {
var isSocketConnected: Bool { get }
var networkConnectionStatusPublisher: AnyPublisher<NetworkConnectionStatus, Never> { get }
var socketConnectionStatusPublisher: AnyPublisher<SocketConnectionStatus, Never> { get }
func send(_ string: String, completion: @escaping (Error?) -> Void)
func protectedSend(_ string: String, completion: @escaping (Error?) -> Void)
func protectedSend(_ string: String) async throws
func connect() throws
Expand Down Expand Up @@ -58,11 +57,7 @@ final class Dispatcher: NSObject, Dispatching {
setUpWebSocketSession()
}

func send(_ string: String, completion: @escaping (Error?) -> Void) {
guard socket.isConnected else {
completion(NetworkError.connectionFailed)
return
}
private func send(_ string: String, completion: @escaping (Error?) -> Void) {
socket.write(string: string) {
completion(nil)
}
Expand Down
2 changes: 1 addition & 1 deletion Sources/WalletConnectRelay/PackageConfig.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"version": "1.0.0"}
{"version": "1.0.1"}
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,7 @@ extension AutomaticSocketConnectionHandler: SocketConnectionHandler {
isConnecting = false
handleFailedConnectionAndReconnectIfNeeded() // Trigger reconnection
}
logger.debug("Will throw an error \(NetworkError.connectionFailed)")
continuation.resume(throwing: NetworkError.connectionFailed)
}
}
Expand Down
2 changes: 1 addition & 1 deletion Tests/RelayerTests/DispatcherTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ final class DispatcherTests: XCTestCase {

func testSendWhileConnected() {
try! sut.connect()
sut.send("1") {_ in}
sut.protectedSend("1") {_ in}
XCTAssertEqual(webSocket.sendCallCount, 1)
}

Expand Down
2 changes: 1 addition & 1 deletion reown-swift.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Pod::Spec.new do |spec|
spec.default_subspecs = 'WalletKit'

spec.subspec 'WalletKit' do |ss|
ss.source_files = 'Sources/WalletKit/**/*.{h,m,swift}'
ss.source_files = 'Sources/ReownWalletKit/**/*.{h,m,swift}'
ss.dependency 'reown-swift/WalletConnectSign'
ss.dependency 'reown-swift/WalletConnectPush'
ss.dependency 'reown-swift/WalletConnectVerify'
Expand Down

0 comments on commit 3aa7e34

Please sign in to comment.