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.6.10 #930

Merged
merged 43 commits into from
Jun 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
f3b8e6e
add notify test
llbartekll Jun 11, 2023
c29b661
savepoint
llbartekll Jun 11, 2023
a8087d7
fix cast test
llbartekll Jun 13, 2023
6b954d6
savepoint
llbartekll Jun 13, 2023
1ac5510
savepoint
llbartekll Jun 13, 2023
f7fea39
add notify test plan
llbartekll Jun 13, 2023
96c0dd8
savepoint
llbartekll Jun 14, 2023
9f18c87
add notify_tests task
llbartekll Jun 14, 2023
47be9a8
add CAST_HOST env var for integration tests task
llbartekll Jun 14, 2023
1ded2ac
update build all task
llbartekll Jun 14, 2023
8404106
Add notify tests action
llbartekll Jun 15, 2023
770ee13
fix makefile
llbartekll Jun 15, 2023
993bb93
fix makefile
llbartekll Jun 15, 2023
111c409
exclude new tests from notify test plan
llbartekll Jun 15, 2023
f18b89b
update failing test
llbartekll Jun 15, 2023
0c5e950
fix typo
llbartekll Jun 15, 2023
e047aa3
add cast var to integration tests
llbartekll Jun 15, 2023
36cd8b3
add gm dapp project id var
llbartekll Jun 15, 2023
270a9f4
Update Configuration.xcconfig
llbartekll Jun 15, 2023
3392494
add gm dapp project id var for action.yml
llbartekll Jun 15, 2023
7a61024
add gm dapp var to makefile
llbartekll Jun 15, 2023
d71c684
update ci.yml
llbartekll Jun 15, 2023
22944a6
fix variable
llbartekll Jun 15, 2023
c2dc7af
add missing vars
llbartekll Jun 16, 2023
f22b462
Merge branch 'develop' of github.com:WalletConnect/WalletConnectSwift…
llbartekll Jun 16, 2023
e8cfbaf
update config
llbartekll Jun 19, 2023
1607a6e
revert package version
llbartekll Jun 19, 2023
8d92009
update makefile
llbartekll Jun 22, 2023
12baf99
Merge branch 'develop' of github.com:WalletConnect/WalletConnectSwift…
llbartekll Jun 22, 2023
2d211e4
fix post merge issue
llbartekll Jun 22, 2023
e97422c
add register device token method to w3i client
llbartekll Jun 23, 2023
9a4e567
add on push to ci.yml
llbartekll Jun 23, 2023
b4c72d4
[W3M] Find and Replace Web3Modal
radeknovis Jun 22, 2023
c50649e
Merge branch 'develop' of github.com:WalletConnect/WalletConnectSwift…
llbartekll Jun 26, 2023
098921a
Merge pull request #925 from WalletConnect/register-device-token-in-w3i
llbartekll Jun 26, 2023
81e6f45
Merge pull request #924 from WalletConnect/feature/w3m-rename
radeknovis Jun 26, 2023
034e6d5
add logger to publisher
llbartekll Jun 26, 2023
8411d36
test
llbartekll Jun 26, 2023
59e3682
makefile fix
llbartekll Jun 26, 2023
e505718
revert logs
llbartekll Jun 26, 2023
57ba25d
revert on push ci.yml trigger
llbartekll Jun 26, 2023
532d0dc
Merge pull request #910 from WalletConnect/cast-test
llbartekll Jun 27, 2023
dfe67f1
Set User Agent
llbartekll Jun 27, 2023
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
21 changes: 18 additions & 3 deletions .github/actions/run_tests_without_building/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,20 @@ inputs:
description: 'The endpoint of the relay e.g. relay.walletconnect.com'
required: false
default: 'relay.walletconnect.com'
notify-endpoint:
description: 'The endpoint of the notify server e.g. cast.walletconnect.com'
required: false
default: 'cast.walletconnect.com'
project-id:
description: 'WalletConnect project id'
required: true
slack-webhook-url:
description: 'Smoke tests slack webhoook url'
required: true
required: false
gm-dapp-project-id:
description: 'GM DApp Project ID'
required: false


runs:
using: "composite"
Expand Down Expand Up @@ -41,20 +49,27 @@ runs:
- name: Run integration tests
if: inputs.type == 'integration-tests'
shell: bash
run: make integration_tests RELAY_HOST=${{ inputs.relay-endpoint }} PROJECT_ID=${{ inputs.project-id }}
run: make integration_tests RELAY_HOST=${{ inputs.relay-endpoint }} PROJECT_ID=${{ inputs.project-id }} CAST_HOST=${{ inputs.notify-endpoint }} GM_DAPP_PROJECT_ID=${{ inputs.gm-dapp-project-id }}

# Relay Integration tests
- name: Run Relay integration tests
if: inputs.type == 'relay-tests'
shell: bash
run: make relay_tests RELAY_HOST=${{ inputs.relay-endpoint }} PROJECT_ID=${{ inputs.project-id }}
run: make relay_tests RELAY_HOST=${{ inputs.relay-endpoint }} PROJECT_ID=${{ inputs.project-id }} CAST_HOST=${{ inputs.notify-endpoint }}

# Smoke tests
- name: Run smoke tests
if: inputs.type == 'smoke-tests'
shell: bash
run: make smoke_tests RELAY_HOST=${{ inputs.relay-endpoint }} PROJECT_ID=${{ inputs.project-id }}

# Notify tests
- name: Run notify tests
if: inputs.type == 'notify-tests'
shell: bash
run: make notify_tests RELAY_HOST=${{ inputs.relay-endpoint }} PROJECT_ID=${{ inputs.project-id }} CAST_HOST=${{ inputs.notify-endpoint }} GM_DAPP_PROJECT_ID=${{ inputs.gm-dapp-project-id }}

# Slack notification for failing smoke and relay tests
- name: Slack Notification for Failure
if: failure() && (inputs.type == 'smoke-tests' || inputs.type == 'relay-tests')
uses: 8398a7/action-slack@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ jobs:
- name: Run integration tests
if: matrix.type == 'integration-tests'
shell: bash
run: make integration_tests RELAY_HOST=relay.walletconnect.com PROJECT_ID=${{ secrets.PROJECT_ID }}
run: make integration_tests RELAY_HOST=relay.walletconnect.com PROJECT_ID=${{ secrets.PROJECT_ID }} CAST_HOST=cast.walletconnect.com GM_DAPP_PROJECT_ID=${{ secrets.GM_DAPP_PROJECT_ID }}

# Relay Integration tests
- name: Run Relay integration tests
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1430"
LastUpgradeVersion = "1500"
version = "1.7">
<BuildAction
parallelizeBuildables = "YES"
Expand All @@ -14,9 +14,9 @@
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "Web3Modal"
BuildableName = "Web3Modal"
BlueprintName = "Web3Modal"
BlueprintIdentifier = "WalletConnectModal"
BuildableName = "WalletConnectModal"
BlueprintName = "WalletConnectModal"
ReferencedContainer = "container:">
</BuildableReference>
</BuildActionEntry>
Expand All @@ -28,6 +28,18 @@
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
shouldAutocreateTestPlan = "YES">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "WalletConnectModalTests"
BuildableName = "WalletConnectModalTests"
BlueprintName = "WalletConnectModalTests"
ReferencedContainer = "container:">
</BuildableReference>
</TestableReference>
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
Expand All @@ -49,9 +61,9 @@
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "Web3Modal"
BuildableName = "Web3Modal"
BlueprintName = "Web3Modal"
BlueprintIdentifier = "WalletConnectModal"
BuildableName = "WalletConnectModal"
BlueprintName = "WalletConnectModal"
ReferencedContainer = "container:">
</BuildableReference>
</MacroExpansion>
Expand Down
5 changes: 5 additions & 0 deletions Configuration.xcconfig
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,8 @@ RELAY_HOST = relay.walletconnect.com

// Uncomment next line and paste your project id. Get this on: https://cloud.walletconnect.com/sign-in
// PROJECT_ID = YOUR_PROJECT_ID

// Uncomment next line and paste dapp id to run all the notify tests
// GM_DAPP_PROJECT_ID = GM_DAPP_PROJECT_ID

CAST_HOST = cast.walletconnect.com
4 changes: 2 additions & 2 deletions Example/DApp/SceneDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import UIKit
import Auth
import WalletConnectRelay
import WalletConnectNetworking
import Web3Modal
import WalletConnectModal

class SceneDelegate: UIResponder, UIWindowSceneDelegate {

Expand All @@ -22,7 +22,7 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate {
icons: ["https://avatars.githubusercontent.com/u/37784886"]
)

Web3Modal.configure(projectId: InputConfig.projectId, metadata: metadata)
WalletConnectModal.configure(projectId: InputConfig.projectId, metadata: metadata)

setupWindow(scene: scene)
}
Expand Down
2 changes: 1 addition & 1 deletion Example/DApp/Sign/Connect/ConnectViewController.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Foundation
import UIKit
import Web3Modal
import WalletConnectModal

class ConnectViewController: UIViewController, UITableViewDataSource, UITableViewDelegate {
let uri: WalletConnectURI
Expand Down
8 changes: 4 additions & 4 deletions Example/DApp/Sign/SelectChain/SelectChainViewController.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Foundation
import Web3Modal
import WalletConnectModal
import UIKit
import Combine

Expand Down Expand Up @@ -71,16 +71,16 @@ class SelectChainViewController: UIViewController, UITableViewDataSource {
]

Task {
Web3Modal.set(sessionParams: .init(
WalletConnectModal.set(sessionParams: .init(
requiredNamespaces: namespaces,
optionalNamespaces: optionalNamespaces,
sessionProperties: sessionProperties
))

let uri = try await Web3Modal.instance.connect(topic: nil)
let uri = try await WalletConnectModal.instance.connect(topic: nil)
}

Web3Modal.present(from: self)
WalletConnectModal.present(from: self)
}

@objc
Expand Down
9 changes: 9 additions & 0 deletions Example/ExampleApp.xcodeproj/IntegrationTests.xctestplan
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,14 @@
"key" : "RELAY_HOST",
"value" : "$(RELAY_HOST)"
},
{
"key" : "GM_DAPP_PROJECT_ID",
"value" : "$(GM_DAPP_PROJECT_ID)"
},
{
"key" : "CAST_HOST",
"value" : "$(CAST_HOST)"
},
{
"key" : "PROJECT_ID",
"value" : "$(PROJECT_ID)"
Expand All @@ -28,6 +36,7 @@
},
"testTargets" : [
{
"parallelizable" : true,
"skippedTests" : [
"AuthTests\/testEIP1271RespondSuccess()",
"ChatTests",
Expand Down
26 changes: 16 additions & 10 deletions Example/ExampleApp.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
847BD1EB298A87AB00076C90 /* SubscriptionsViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 847BD1EA298A87AB00076C90 /* SubscriptionsViewModel.swift */; };
847CF3AF28E3141700F1D760 /* WalletConnectPush in Frameworks */ = {isa = PBXBuildFile; productRef = 847CF3AE28E3141700F1D760 /* WalletConnectPush */; settings = {ATTRIBUTES = (Required, ); }; };
849D7A93292E2169006A2BD4 /* PushTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 849D7A92292E2169006A2BD4 /* PushTests.swift */; };
84A6E3C32A386BBC008A0571 /* Publisher.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84A6E3C22A386BBC008A0571 /* Publisher.swift */; };
84AA01DB28CF0CD7005D48D8 /* XCTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84AA01DA28CF0CD7005D48D8 /* XCTest.swift */; };
84B8154E2991099000FAD54E /* BuildConfiguration.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84B8154D2991099000FAD54E /* BuildConfiguration.swift */; };
84B815542991217900FAD54E /* PushMessagesModule.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84B8154F2991217900FAD54E /* PushMessagesModule.swift */; };
Expand Down Expand Up @@ -282,17 +283,17 @@
C5F32A322954816C00A6476E /* ConnectionDetailsPresenter.swift in Sources */ = {isa = PBXBuildFile; fileRef = C5F32A312954816C00A6476E /* ConnectionDetailsPresenter.swift */; };
C5F32A342954817600A6476E /* ConnectionDetailsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = C5F32A332954817600A6476E /* ConnectionDetailsView.swift */; };
C5F32A362954FE3C00A6476E /* Colors.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = C5F32A352954FE3C00A6476E /* Colors.xcassets */; };
CF140F2D2A2A288D00BEB791 /* Web3Modal in Frameworks */ = {isa = PBXBuildFile; productRef = CF140F2C2A2A288D00BEB791 /* Web3Modal */; };
CF1A594529E5876600AAC16B /* XCUIElement.swift in Sources */ = {isa = PBXBuildFile; fileRef = CF1A593A29E5876600AAC16B /* XCUIElement.swift */; };
CF1A594629E5876600AAC16B /* PushNotificationTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = CF1A593C29E5876600AAC16B /* PushNotificationTests.swift */; };
CF1A594829E5876600AAC16B /* Engine.swift in Sources */ = {isa = PBXBuildFile; fileRef = CF1A593F29E5876600AAC16B /* Engine.swift */; };
CF1A594929E5876600AAC16B /* WalletEngine.swift in Sources */ = {isa = PBXBuildFile; fileRef = CF1A594029E5876600AAC16B /* WalletEngine.swift */; };
CF1A594B29E5876600AAC16B /* DAppEngine.swift in Sources */ = {isa = PBXBuildFile; fileRef = CF1A594229E5876600AAC16B /* DAppEngine.swift */; };
CF1A594C29E5876600AAC16B /* RoutingEngine.swift in Sources */ = {isa = PBXBuildFile; fileRef = CF1A594329E5876600AAC16B /* RoutingEngine.swift */; };
CF1A594D29E5876600AAC16B /* App.swift in Sources */ = {isa = PBXBuildFile; fileRef = CF1A594429E5876600AAC16B /* App.swift */; };
CF25F2892A432476009C7E49 /* WalletConnectModal in Frameworks */ = {isa = PBXBuildFile; productRef = CF25F2882A432476009C7E49 /* WalletConnectModal */; };
CF25F28B2A432488009C7E49 /* WalletConnectModal in Frameworks */ = {isa = PBXBuildFile; productRef = CF25F28A2A432488009C7E49 /* WalletConnectModal */; };
CF6704DF29E59DDC003326A4 /* XCUIElementQuery.swift in Sources */ = {isa = PBXBuildFile; fileRef = CF6704DE29E59DDC003326A4 /* XCUIElementQuery.swift */; };
CF6704E129E5A014003326A4 /* XCTestCase.swift in Sources */ = {isa = PBXBuildFile; fileRef = CF6704E029E5A014003326A4 /* XCTestCase.swift */; };
CF9C7E4A2A01802F0037C006 /* Web3Modal in Frameworks */ = {isa = PBXBuildFile; productRef = CF9C7E492A01802F0037C006 /* Web3Modal */; };
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
Expand Down Expand Up @@ -379,6 +380,8 @@
849A4F18298281E300E61ACE /* WalletAppRelease.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = WalletAppRelease.entitlements; sourceTree = "<group>"; };
849A4F19298281F100E61ACE /* PNDecryptionServiceRelease.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = PNDecryptionServiceRelease.entitlements; sourceTree = "<group>"; };
849D7A92292E2169006A2BD4 /* PushTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PushTests.swift; sourceTree = "<group>"; };
84A6E3C22A386BBC008A0571 /* Publisher.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Publisher.swift; sourceTree = "<group>"; };
84A6E3C42A38A5A3008A0571 /* NotifyTests.xctestplan */ = {isa = PBXFileReference; lastKnownFileType = text; name = NotifyTests.xctestplan; path = ../NotifyTests.xctestplan; sourceTree = "<group>"; };
84AA01DA28CF0CD7005D48D8 /* XCTest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = XCTest.swift; sourceTree = "<group>"; };
84B8154D2991099000FAD54E /* BuildConfiguration.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BuildConfiguration.swift; sourceTree = "<group>"; };
84B8154F2991217900FAD54E /* PushMessagesModule.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PushMessagesModule.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -622,9 +625,9 @@
buildActionMask = 2147483647;
files = (
8448F1D427E4726F0000B866 /* WalletConnect in Frameworks */,
CF25F28B2A432488009C7E49 /* WalletConnectModal in Frameworks */,
A54195A52934E83F0035AD19 /* Web3 in Frameworks */,
84E6B8652981720400428BAF /* WalletConnectPush in Frameworks */,
CF140F2D2A2A288D00BEB791 /* Web3Modal in Frameworks */,
A5D85228286333E300DAF5C3 /* Starscream in Frameworks */,
A573C53929EC365000E3CBFD /* HDWalletKit in Frameworks */,
A5BB7FA328B6A50400707FC6 /* WalletConnectAuth in Frameworks */,
Expand All @@ -643,9 +646,9 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
CF9C7E4A2A01802F0037C006 /* Web3Modal in Frameworks */,
A58EC618299D665A00F3452A /* Web3Inbox in Frameworks */,
A5629AEA2877F2D600094373 /* WalletConnectChat in Frameworks */,
CF25F2892A432476009C7E49 /* WalletConnectModal in Frameworks */,
A561C80029DF32CE00DF540D /* HDWalletKit in Frameworks */,
A59FAEC928B7B93A002BB66F /* Web3 in Frameworks */,
A5629AF22877F75100094373 /* Starscream in Frameworks */,
Expand Down Expand Up @@ -709,6 +712,7 @@
children = (
CF79389D29EDD9DC00441B4F /* RelayIntegrationTests.xctestplan */,
845AA7D929BA1EBA00F33739 /* IntegrationTests.xctestplan */,
84A6E3C42A38A5A3008A0571 /* NotifyTests.xctestplan */,
845AA7DC29BB424800F33739 /* SmokeTests.xctestplan */,
A5A8E479293A1C4400FEB97D /* Shared */,
A5F48A0528E43D3F0034CBFB /* Configuration.xcconfig */,
Expand Down Expand Up @@ -825,6 +829,7 @@
isa = PBXGroup;
children = (
849D7A92292E2169006A2BD4 /* PushTests.swift */,
84A6E3C22A386BBC008A0571 /* Publisher.swift */,
);
path = Push;
sourceTree = "<group>";
Expand Down Expand Up @@ -1778,8 +1783,8 @@
A5BB7FA228B6A50400707FC6 /* WalletConnectAuth */,
A54195A42934E83F0035AD19 /* Web3 */,
84E6B8642981720400428BAF /* WalletConnectPush */,
CF140F2C2A2A288D00BEB791 /* Web3Modal */,
A573C53829EC365000E3CBFD /* HDWalletKit */,
CF25F28A2A432488009C7E49 /* WalletConnectModal */,
);
productName = DApp;
productReference = 84CE641C27981DED00142511 /* DApp.app */;
Expand Down Expand Up @@ -1825,8 +1830,8 @@
A59FAEC828B7B93A002BB66F /* Web3 */,
A58EC610299D57B800F3452A /* AsyncButton */,
A58EC617299D665A00F3452A /* Web3Inbox */,
CF9C7E492A01802F0037C006 /* Web3Modal */,
A561C7FF29DF32CE00DF540D /* HDWalletKit */,
CF25F2882A432476009C7E49 /* WalletConnectModal */,
);
productName = Showcase;
productReference = A58E7CE828729F550082D443 /* Showcase.app */;
Expand Down Expand Up @@ -2229,6 +2234,7 @@
A5321C2B2A250367006CADC3 /* HistoryTests.swift in Sources */,
A58A1ECC29BF458600A82A20 /* ENSResolverTests.swift in Sources */,
A5E03DFA286465C700888481 /* SignClientTests.swift in Sources */,
84A6E3C32A386BBC008A0571 /* Publisher.swift in Sources */,
A54195A02934BFEF0035AD19 /* EIP1271VerifierTests.swift in Sources */,
A54195A12934BFEF0035AD19 /* EIP191VerifierTests.swift in Sources */,
84AA01DB28CF0CD7005D48D8 /* XCTest.swift in Sources */,
Expand Down Expand Up @@ -3243,13 +3249,13 @@
isa = XCSwiftPackageProductDependency;
productName = Web3Wallet;
};
CF140F2C2A2A288D00BEB791 /* Web3Modal */ = {
CF25F2882A432476009C7E49 /* WalletConnectModal */ = {
isa = XCSwiftPackageProductDependency;
productName = Web3Modal;
productName = WalletConnectModal;
};
CF9C7E492A01802F0037C006 /* Web3Modal */ = {
CF25F28A2A432488009C7E49 /* WalletConnectModal */ = {
isa = XCSwiftPackageProductDependency;
productName = Web3Modal;
productName = WalletConnectModal;
};
/* End XCSwiftPackageProductDependency section */
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@
<TestPlanReference
reference = "container:RelayIntegrationTests.xctestplan">
</TestPlanReference>
<TestPlanReference
reference = "container:../NotifyTests.xctestplan">
</TestPlanReference>
</TestPlans>
</TestAction>
<LaunchAction
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@
<TestPlanReference
reference = "container:SmokeTests.xctestplan">
</TestPlanReference>
<TestPlanReference
reference = "container:../NotifyTests.xctestplan">
</TestPlanReference>
</TestPlans>
<Testables>
<TestableReference
Expand Down Expand Up @@ -87,15 +90,6 @@
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "A5E03DEC286464DB00888481"
BuildableName = "IntegrationTests.xctest"
BlueprintName = "IntegrationTests"
ReferencedContainer = "container:ExampleApp.xcodeproj">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
Expand Down
23 changes: 23 additions & 0 deletions Example/IntegrationTests/Push/Publisher.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
@testable import WalletConnectPush
import Foundation

class Publisher {
func notify(topic: String, account: Account, message: PushMessage) async throws {
let url = URL(string: "https://\(InputConfig.castHost)/\(InputConfig.gmDappProjectId)/notify")!
var request = URLRequest(url: url)
let notifyRequestPayload = NotifyRequest(notification: message, accounts: [account])
let encoder = JSONEncoder()
encoder.outputFormatting = .withoutEscapingSlashes
let payload = try encoder.encode(notifyRequestPayload)
request.httpMethod = "POST"
request.setValue("application/json", forHTTPHeaderField: "Content-Type")
request.httpBody = payload
let (_, response) = try await URLSession.shared.data(for: request)
guard (response as? HTTPURLResponse)?.statusCode == 200 else { fatalError("Notify error") }
}
}

struct NotifyRequest: Codable {
let notification: PushMessage
let accounts: [Account]
}
Loading
Loading