Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1.0.1 #13

Merged
merged 5 commits into from
Sep 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading