Skip to content

Commit

Permalink
Merge pull request #508 from WalletConnect/develop
Browse files Browse the repository at this point in the history
[Release] 0.10.3-rc0
  • Loading branch information
flypaper0 authored Sep 15, 2022
2 parents 98e9693 + 93bef41 commit 099ed68
Show file tree
Hide file tree
Showing 15 changed files with 216 additions and 171 deletions.
4 changes: 4 additions & 0 deletions Example/ExampleApp.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
8448F1D427E4726F0000B866 /* WalletConnect in Frameworks */ = {isa = PBXBuildFile; productRef = 8448F1D327E4726F0000B866 /* WalletConnect */; };
84494388278D9C1B00CC26BB /* UIAlertController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84494387278D9C1B00CC26BB /* UIAlertController.swift */; };
8460DCFC274F98A10081F94C /* RequestViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8460DCFB274F98A10081F94C /* RequestViewController.swift */; };
84AA01DB28CF0CD7005D48D8 /* XCTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84AA01DA28CF0CD7005D48D8 /* XCTest.swift */; };
84CE641F27981DED00142511 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84CE641E27981DED00142511 /* AppDelegate.swift */; };
84CE642127981DED00142511 /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84CE642027981DED00142511 /* SceneDelegate.swift */; };
84CE642827981DF000142511 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 84CE642727981DF000142511 /* Assets.xcassets */; };
Expand Down Expand Up @@ -219,6 +220,7 @@
76B6E39E2807A3B6004DF775 /* WalletViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WalletViewController.swift; sourceTree = "<group>"; };
84494387278D9C1B00CC26BB /* UIAlertController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UIAlertController.swift; sourceTree = "<group>"; };
8460DCFB274F98A10081F94C /* RequestViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RequestViewController.swift; sourceTree = "<group>"; };
84AA01DA28CF0CD7005D48D8 /* XCTest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = XCTest.swift; sourceTree = "<group>"; };
84CE641C27981DED00142511 /* DApp.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = DApp.app; sourceTree = BUILT_PRODUCTS_DIR; };
84CE641E27981DED00142511 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
84CE642027981DED00142511 /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -503,6 +505,7 @@
children = (
A50C036428AAD32200FE72D3 /* ClientDelegate.swift */,
767DC83428997F8E00080FA9 /* EthSendTransaction.swift */,
84AA01DA28CF0CD7005D48D8 /* XCTest.swift */,
);
path = Helpers;
sourceTree = "<group>";
Expand Down Expand Up @@ -1462,6 +1465,7 @@
A501AC2728C8E59800CEAA42 /* URLConfig.swift in Sources */,
A5E03DFA286465C700888481 /* SignClientTests.swift in Sources */,
A5E03E0F28646D8A00888481 /* WebSocketFactory.swift in Sources */,
84AA01DB28CF0CD7005D48D8 /* XCTest.swift in Sources */,
A5E03E1128646F8000888481 /* KeychainStorageMock.swift in Sources */,
A5E03DFD286465D100888481 /* Stubs.swift in Sources */,
);
Expand Down
6 changes: 4 additions & 2 deletions Example/ExampleApp/SceneDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,11 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate {

Relay.configure(projectId: "3ca2919724fbfa5456a25194e369a8b4", socketFactory: SocketFactory())
Sign.configure(metadata: metadata)

#if DEBUG
if CommandLine.arguments.contains("-cleanInstall") {
try? Sign.instance.cleanup()
}
#endif

guard let windowScene = (scene as? UIWindowScene) else { return }
window = UIWindow(windowScene: windowScene)
Expand All @@ -43,8 +44,9 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate {
}
let wcUri = incomingURL.absoluteString.deletingPrefix("https://walletconnect.com/wc?uri=")
let vc = ((window!.rootViewController as! UINavigationController).viewControllers[0] as! WalletViewController)
Task(priority: .high) {try? await Sign.instance.pair(uri: WalletConnectURI(string: wcUri)!)}
vc.onClientConnected = {
Task {
Task(priority: .high) {
do {
try await Sign.instance.pair(uri: WalletConnectURI(string: wcUri)!)
} catch {
Expand Down
2 changes: 1 addition & 1 deletion Example/ExampleApp/SessionProposal/Proposal.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ struct Proposal {
self.proposerName = proposal.proposer.name
self.proposerDescription = proposal.proposer.description
self.proposerURL = proposal.proposer.url
self.iconURL = proposal.proposer.icons.first!
self.iconURL = proposal.proposer.icons.first ?? "https://avatars.githubusercontent.com/u/37784886"
self.permissions = [
Namespace(
chains: ["eip155:1"],
Expand Down
5 changes: 2 additions & 3 deletions Example/IntegrationTests/Relay/RelayClientEndToEndTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,8 @@ final class RelayClientEndToEndTests: XCTestCase {
XCTAssertEqual(subscriptionATopic, randomTopic)
XCTAssertEqual(subscriptionBTopic, randomTopic)

// TODO - uncomment lines when request rebound is resolved
// XCTAssertEqual(subscriptionBPayload, payloadA)
// XCTAssertEqual(subscriptionAPayload, payloadB)
XCTAssertEqual(subscriptionBPayload, payloadA)
XCTAssertEqual(subscriptionAPayload, payloadB)
}
}

Expand Down
19 changes: 19 additions & 0 deletions Example/IntegrationTests/Sign/Helpers/XCTest.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import Foundation
import XCTest

extension XCTest {
public func XCTAssertThrowsErrorAsync<T: Sendable>(
_ expression: @autoclosure () async throws -> T,
_ message: @autoclosure () -> String = "",
file: StaticString = #filePath,
line: UInt = #line,
_ errorHandler: (_ error: Error) -> Void = { _ in }
) async {
do {
_ = try await expression()
XCTFail(message(), file: file, line: line)
} catch {
errorHandler(error)
}
}
}
Loading

0 comments on commit 099ed68

Please sign in to comment.