From 83414c83c46e164d0e875cef946da51c42f2faf4 Mon Sep 17 00:00:00 2001 From: Bartosz Rozwarski Date: Mon, 18 Sep 2023 22:04:25 +0300 Subject: [PATCH 01/17] config gm dapp --- Example/IntegrationTests/Push/NotifyTests.swift | 2 +- Example/Shared/Tests/InputConfig.swift | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Example/IntegrationTests/Push/NotifyTests.swift b/Example/IntegrationTests/Push/NotifyTests.swift index 83b91e47e..d5c2391ae 100644 --- a/Example/IntegrationTests/Push/NotifyTests.swift +++ b/Example/IntegrationTests/Push/NotifyTests.swift @@ -16,7 +16,7 @@ final class NotifyTests: XCTestCase { var walletNotifyClientA: NotifyClient! - let gmDappDomain = "gm.walletconnect.com" + let gmDappDomain = InputConfig.gmDappHost let pk = try! EthereumPrivateKey() diff --git a/Example/Shared/Tests/InputConfig.swift b/Example/Shared/Tests/InputConfig.swift index e32975741..7f3dd03f5 100644 --- a/Example/Shared/Tests/InputConfig.swift +++ b/Example/Shared/Tests/InputConfig.swift @@ -14,6 +14,10 @@ struct InputConfig { return config(for: "GM_DAPP_PROJECT_ID")! } + static var gmDappHost: String { + return config(for: "GM_DAPP_HOST")! + } + static var gmDappProjectSecret: String { return config(for: "GM_DAPP_PROJECT_SECRET")! } From a1b2ce7eecb04c784a55d64e222ecb53823f0eb7 Mon Sep 17 00:00:00 2001 From: Bartosz Rozwarski Date: Mon, 18 Sep 2023 22:07:04 +0300 Subject: [PATCH 02/17] update actions.yml --- .github/actions/run_tests_without_building/action.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/actions/run_tests_without_building/action.yml b/.github/actions/run_tests_without_building/action.yml index f8d0a3743..1377e41e5 100644 --- a/.github/actions/run_tests_without_building/action.yml +++ b/.github/actions/run_tests_without_building/action.yml @@ -24,6 +24,9 @@ inputs: gm-dapp-project-secret: description: 'GM DApp Project Secret' required: false + gm-dapp-host: + description: 'GM DApp Host' + required: false js-client-api-host: description: 'JS Client Api Host' required: false @@ -55,7 +58,7 @@ 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 }} CAST_HOST=${{ inputs.notify-endpoint }} GM_DAPP_PROJECT_ID=${{ inputs.gm-dapp-project-id }} GM_DAPP_PROJECT_SECRET=${{ inputs.gm-dapp-project-secret }} JS_CLIENT_API_HOST=${{ inputs.js-client-api-host }} + 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 }} GM_DAPP_PROJECT_SECRET=${{ inputs.gm-dapp-project-secret }} GM_DAPP_HOST=${{ inputs.gm-dapp-host }} JS_CLIENT_API_HOST=${{ inputs.js-client-api-host }} # Relay Integration tests - name: Run Relay integration tests @@ -73,7 +76,7 @@ runs: - 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 }} GM_DAPP_PROJECT_SECRET=${{ inputs.gm-dapp-project-secret }} + 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 }} GM_DAPP_PROJECT_SECRET=${{ inputs.gm-dapp-project-secret }} GM_DAPP_HOST=${{ inputs.gm-dapp-host }} - name: Run x-platform protocol tests if: inputs.type == 'x-platform-protocol-tests' From 2f4db7e743b8397d9b6d03e66b2ec8b871c94b37 Mon Sep 17 00:00:00 2001 From: Bartosz Rozwarski Date: Mon, 18 Sep 2023 22:08:32 +0300 Subject: [PATCH 03/17] update ci.yml --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ef5f81953..a6f586ffa 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -69,7 +69,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 }} CAST_HOST=notify.walletconnect.com GM_DAPP_PROJECT_ID=${{ secrets.GM_DAPP_PROJECT_ID }} GM_DAPP_PROJECT_SECRET=${{ secrets.GM_DAPP_PROJECT_SECRET }} JS_CLIENT_API_HOST=test-automation-api.walletconnect.com + run: make integration_tests RELAY_HOST=relay.walletconnect.com PROJECT_ID=${{ secrets.PROJECT_ID }} CAST_HOST=notify.walletconnect.com GM_DAPP_PROJECT_ID=${{ secrets.GM_DAPP_PROJECT_ID }} GM_DAPP_PROJECT_SECRET=${{ secrets.GM_DAPP_PROJECT_SECRET }} GM_DAPP_HOST=${{ inputs.gm-dapp-host }} JS_CLIENT_API_HOST=test-automation-api.walletconnect.com # Relay Integration tests - name: Run Relay integration tests From 13e8a2efd650c63a7e2ee95f5e20d9bc9932b484 Mon Sep 17 00:00:00 2001 From: Bartosz Rozwarski Date: Mon, 18 Sep 2023 22:13:21 +0300 Subject: [PATCH 04/17] update run tests.sh --- run_tests.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/run_tests.sh b/run_tests.sh index eb906df0e..0b1ff5acf 100755 --- a/run_tests.sh +++ b/run_tests.sh @@ -84,6 +84,7 @@ else update_xctestrun --key "PROJECT_ID" --value "$PROJECT_ID" --target "$XCTESTRUN" update_xctestrun --key "GM_DAPP_PROJECT_ID" --value "$GM_DAPP_PROJECT_ID" --target "$XCTESTRUN" update_xctestrun --key "GM_DAPP_PROJECT_SECRET" --value "$GM_DAPP_PROJECT_SECRET" --target "$XCTESTRUN" + update_xctestrun --key "GM_DAPP_HOST" --value "$GM_DAPP_PROJECT_HOST" --target "$XCTESTRUN" update_xctestrun --key "CAST_HOST" --value "$CAST_HOST" --target "$XCTESTRUN" update_xctestrun --key "JS_CLIENT_API_HOST" --value "$JS_CLIENT_API_HOST" --target "$XCTESTRUN" From 390217b7ebf24d49c5176be3ad837237a21eab59 Mon Sep 17 00:00:00 2001 From: Bartosz Rozwarski Date: Mon, 18 Sep 2023 22:18:10 +0300 Subject: [PATCH 05/17] fix --- .github/actions/run_tests_without_building/action.yml | 1 + .github/workflows/ci.yml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/actions/run_tests_without_building/action.yml b/.github/actions/run_tests_without_building/action.yml index 1377e41e5..a9639e3db 100644 --- a/.github/actions/run_tests_without_building/action.yml +++ b/.github/actions/run_tests_without_building/action.yml @@ -27,6 +27,7 @@ inputs: gm-dapp-host: description: 'GM DApp Host' required: false + default: 'gm.walletconnect.com' js-client-api-host: description: 'JS Client Api Host' required: false diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a6f586ffa..5a9b07721 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -69,7 +69,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 }} CAST_HOST=notify.walletconnect.com GM_DAPP_PROJECT_ID=${{ secrets.GM_DAPP_PROJECT_ID }} GM_DAPP_PROJECT_SECRET=${{ secrets.GM_DAPP_PROJECT_SECRET }} GM_DAPP_HOST=${{ inputs.gm-dapp-host }} JS_CLIENT_API_HOST=test-automation-api.walletconnect.com + run: make integration_tests RELAY_HOST=relay.walletconnect.com PROJECT_ID=${{ secrets.PROJECT_ID }} CAST_HOST=notify.walletconnect.com GM_DAPP_PROJECT_ID=${{ secrets.GM_DAPP_PROJECT_ID }} GM_DAPP_PROJECT_SECRET=${{ secrets.GM_DAPP_PROJECT_SECRET }} GM_DAPP_HOST=gm.walletconnect.com JS_CLIENT_API_HOST=test-automation-api.walletconnect.com # Relay Integration tests - name: Run Relay integration tests From 57545ce04185be8aa8f708c9a62b6a94c353946c Mon Sep 17 00:00:00 2001 From: Bartosz Rozwarski Date: Mon, 18 Sep 2023 22:28:08 +0300 Subject: [PATCH 06/17] update config file --- Configuration.xcconfig | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Configuration.xcconfig b/Configuration.xcconfig index 361714e46..98daaddd4 100644 --- a/Configuration.xcconfig +++ b/Configuration.xcconfig @@ -9,6 +9,9 @@ RELAY_HOST = relay.walletconnect.com // Uncomment next line and paste dapp's project secret to run all the notify tests // GM_DAPP_PROJECT_SECRET = GM_DAPP_PROJECT_SECRET +// Uncomment next line and paste dapp's host to run all the notify tests +// GM_DAPP_HOST = GM_DAPP_HOST + // Uncomment next line and paste js client's api host to run x-platform tests // JS_CLIENT_API_HOST = JS_CLIENT_API_HOST From 1989f76b518bd693d4317519c78a52a947963190 Mon Sep 17 00:00:00 2001 From: Bartosz Rozwarski Date: Mon, 18 Sep 2023 22:33:00 +0300 Subject: [PATCH 07/17] update test plans --- Example/ExampleApp.xcodeproj/IntegrationTests.xctestplan | 4 ++++ NotifyTests.xctestplan | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/Example/ExampleApp.xcodeproj/IntegrationTests.xctestplan b/Example/ExampleApp.xcodeproj/IntegrationTests.xctestplan index 0fb2db965..d06ccb2ba 100644 --- a/Example/ExampleApp.xcodeproj/IntegrationTests.xctestplan +++ b/Example/ExampleApp.xcodeproj/IntegrationTests.xctestplan @@ -15,6 +15,10 @@ "key" : "RELAY_HOST", "value" : "$(RELAY_HOST)" }, + { + "key" : "GM_DAPP_HOST", + "value" : "$(GM_DAPP_HOST)" + }, { "key" : "JS_CLIENT_API_HOST", "value" : "$(JS_CLIENT_API_HOST)" diff --git a/NotifyTests.xctestplan b/NotifyTests.xctestplan index d626fa6e0..881dd5fda 100644 --- a/NotifyTests.xctestplan +++ b/NotifyTests.xctestplan @@ -15,6 +15,10 @@ "key" : "RELAY_HOST", "value" : "$(RELAY_HOST)" }, + { + "key" : "GM_DAPP_HOST", + "value" : "$(GM_DAPP_HOST)" + }, { "key" : "GM_DAPP_PROJECT_SECRET", "value" : "$(GM_DAPP_PROJECT_SECRET)" From 3a73013596b465f84a2dd5b577a042c54569a776 Mon Sep 17 00:00:00 2001 From: Bartosz Rozwarski Date: Mon, 18 Sep 2023 22:33:29 +0300 Subject: [PATCH 08/17] remove metadata --- Example/IntegrationTests/Push/NotifyTests.swift | 2 -- 1 file changed, 2 deletions(-) diff --git a/Example/IntegrationTests/Push/NotifyTests.swift b/Example/IntegrationTests/Push/NotifyTests.swift index d5c2391ae..10ab55466 100644 --- a/Example/IntegrationTests/Push/NotifyTests.swift +++ b/Example/IntegrationTests/Push/NotifyTests.swift @@ -189,8 +189,6 @@ final class NotifyTests: XCTestCase { let messageExpectation = expectation(description: "receives a notify message") let notifyMessage = NotifyMessage.stub() - let metadata = AppMetadata(name: "GM Dapp", description: "", url: gmDappDomain, icons: []) - try! await walletNotifyClientA.register(account: account, domain: gmDappDomain, onSign: sign) try! await walletNotifyClientA.subscribe(appDomain: gmDappDomain, account: account) From d57c380dd5f882b8f47d087846fcfcbf068cfa93 Mon Sep 17 00:00:00 2001 From: Bartosz Rozwarski Date: Mon, 18 Sep 2023 22:45:47 +0300 Subject: [PATCH 09/17] test --- Example/IntegrationTests/Push/NotifyTests.swift | 1 - 1 file changed, 1 deletion(-) diff --git a/Example/IntegrationTests/Push/NotifyTests.swift b/Example/IntegrationTests/Push/NotifyTests.swift index 10ab55466..f395aaf05 100644 --- a/Example/IntegrationTests/Push/NotifyTests.swift +++ b/Example/IntegrationTests/Push/NotifyTests.swift @@ -188,7 +188,6 @@ final class NotifyTests: XCTestCase { let subscribeExpectation = expectation(description: "creates notify subscription") let messageExpectation = expectation(description: "receives a notify message") let notifyMessage = NotifyMessage.stub() - try! await walletNotifyClientA.register(account: account, domain: gmDappDomain, onSign: sign) try! await walletNotifyClientA.subscribe(appDomain: gmDappDomain, account: account) From 7b2f212641794db20688ba20ebb334e1354e9451 Mon Sep 17 00:00:00 2001 From: Artur Guseinov Date: Tue, 19 Sep 2023 18:18:48 +0800 Subject: [PATCH 10/17] WalletConnectUtils link removed --- Sources/WalletConnectUtils/Logger/ConsoleLogger.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Sources/WalletConnectUtils/Logger/ConsoleLogger.swift b/Sources/WalletConnectUtils/Logger/ConsoleLogger.swift index bfd5ccd26..a9f6b348d 100644 --- a/Sources/WalletConnectUtils/Logger/ConsoleLogger.swift +++ b/Sources/WalletConnectUtils/Logger/ConsoleLogger.swift @@ -111,8 +111,8 @@ extension ConsoleLogger: ConsoleLogging { #if DEBUG public struct ConsoleLoggerMock: ConsoleLogging { - public var logsPublisher: AnyPublisher { - return PassthroughSubject().eraseToAnyPublisher() + public var logsPublisher: AnyPublisher { + return PassthroughSubject().eraseToAnyPublisher() } public init() {} From 79f4d2c3db113f88789236ccb872b7f4dd321c52 Mon Sep 17 00:00:00 2001 From: Bartosz Rozwarski Date: Tue, 19 Sep 2023 13:29:54 +0300 Subject: [PATCH 11/17] test --- .github/workflows/ci.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5a9b07721..867b9f68c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,6 +6,10 @@ on: - develop - main + push: + branches: + - configure-gm-dapp-host + concurrency: group: ${{ github.workflow }}-${{ github.event_name == 'pull_request_target' && github.event.pull_request.number || github.ref_name }} cancel-in-progress: ${{ github.event_name == 'pull_request_target' }} From a77d5a0f9556be1a78b2eaed985347e7c2ce0ea7 Mon Sep 17 00:00:00 2001 From: Bartosz Rozwarski Date: Tue, 19 Sep 2023 13:32:01 +0300 Subject: [PATCH 12/17] test --- Example/IntegrationTests/Push/Publisher.swift | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Example/IntegrationTests/Push/Publisher.swift b/Example/IntegrationTests/Push/Publisher.swift index 5ee993759..6908ec50b 100644 --- a/Example/IntegrationTests/Push/Publisher.swift +++ b/Example/IntegrationTests/Push/Publisher.swift @@ -4,6 +4,14 @@ import Foundation class Publisher { func notify(topic: String, account: Account, message: NotifyMessage) async throws { let url = URL(string: "https://\(InputConfig.castHost)/\(InputConfig.gmDappProjectId)/notify")! + print("________________________________________") + print("________________________________________") + print("________________________________________") + print(InputConfig.gmDappHost) + print("________________________________________") + print("________________________________________") + print("________________________________________") + var request = URLRequest(url: url) let notifyRequestPayload = NotifyRequest(notification: message, accounts: [account]) let encoder = JSONEncoder() From 9297a2f10e50d98570ac6157d6808fcd32361b0d Mon Sep 17 00:00:00 2001 From: flypaper0 Date: Tue, 19 Sep 2023 10:43:20 +0000 Subject: [PATCH 13/17] Set User Agent --- Sources/WalletConnectRelay/PackageConfig.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/WalletConnectRelay/PackageConfig.json b/Sources/WalletConnectRelay/PackageConfig.json index 594e69a66..21c0f27c7 100644 --- a/Sources/WalletConnectRelay/PackageConfig.json +++ b/Sources/WalletConnectRelay/PackageConfig.json @@ -1 +1 @@ -{"version": "1.8.0"} +{"version": "1.8.1"} From f9b33431964977e79b1cc9e1bf5d4bf1659fbc66 Mon Sep 17 00:00:00 2001 From: Bartosz Rozwarski Date: Tue, 19 Sep 2023 14:11:20 +0300 Subject: [PATCH 14/17] test --- Example/IntegrationTests/Push/NotifyTests.swift | 1 - 1 file changed, 1 deletion(-) diff --git a/Example/IntegrationTests/Push/NotifyTests.swift b/Example/IntegrationTests/Push/NotifyTests.swift index f395aaf05..36c7f82b8 100644 --- a/Example/IntegrationTests/Push/NotifyTests.swift +++ b/Example/IntegrationTests/Push/NotifyTests.swift @@ -124,7 +124,6 @@ final class NotifyTests: XCTestCase { try! await walletNotifyClientA.subscribe(appDomain: gmDappDomain, account: account) sleep(1) - try! await clientB.register(account: account, domain: gmDappDomain, onSign: sign) wait(for: [expectation], timeout: InputConfig.defaultTimeout) From af32855ba84dd9605baed3a2eba81be642dfa7f3 Mon Sep 17 00:00:00 2001 From: Bartosz Rozwarski Date: Tue, 19 Sep 2023 14:14:08 +0300 Subject: [PATCH 15/17] fix --- run_tests.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/run_tests.sh b/run_tests.sh index 0b1ff5acf..ea5cad206 100755 --- a/run_tests.sh +++ b/run_tests.sh @@ -84,7 +84,7 @@ else update_xctestrun --key "PROJECT_ID" --value "$PROJECT_ID" --target "$XCTESTRUN" update_xctestrun --key "GM_DAPP_PROJECT_ID" --value "$GM_DAPP_PROJECT_ID" --target "$XCTESTRUN" update_xctestrun --key "GM_DAPP_PROJECT_SECRET" --value "$GM_DAPP_PROJECT_SECRET" --target "$XCTESTRUN" - update_xctestrun --key "GM_DAPP_HOST" --value "$GM_DAPP_PROJECT_HOST" --target "$XCTESTRUN" + update_xctestrun --key "GM_DAPP_HOST" --value "$GM_DAPP_HOST" --target "$XCTESTRUN" update_xctestrun --key "CAST_HOST" --value "$CAST_HOST" --target "$XCTESTRUN" update_xctestrun --key "JS_CLIENT_API_HOST" --value "$JS_CLIENT_API_HOST" --target "$XCTESTRUN" From 03d58d5dd2424fdd25c3aa97d3a519bcfe03fe10 Mon Sep 17 00:00:00 2001 From: Bartosz Rozwarski Date: Tue, 19 Sep 2023 14:27:41 +0300 Subject: [PATCH 16/17] disable sync tests --- Example/ExampleApp.xcodeproj/IntegrationTests.xctestplan | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Example/ExampleApp.xcodeproj/IntegrationTests.xctestplan b/Example/ExampleApp.xcodeproj/IntegrationTests.xctestplan index d06ccb2ba..896a5c3c7 100644 --- a/Example/ExampleApp.xcodeproj/IntegrationTests.xctestplan +++ b/Example/ExampleApp.xcodeproj/IntegrationTests.xctestplan @@ -52,7 +52,9 @@ "skippedTests" : [ "AuthTests\/testEIP1271RespondSuccess()", "ChatTests", - "ENSResolverTests" + "ENSResolverTests", + "SyncDerivationServiceTests", + "SyncTests" ], "target" : { "containerPath" : "container:ExampleApp.xcodeproj", From 9066af2f0f3387ac284420983db1e9ce6b00a138 Mon Sep 17 00:00:00 2001 From: Bartosz Rozwarski Date: Tue, 19 Sep 2023 14:33:45 +0300 Subject: [PATCH 17/17] remove on push --- .github/workflows/ci.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 867b9f68c..5a9b07721 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,10 +6,6 @@ on: - develop - main - push: - branches: - - configure-gm-dapp-host - concurrency: group: ${{ github.workflow }}-${{ github.event_name == 'pull_request_target' && github.event.pull_request.number || github.ref_name }} cancel-in-progress: ${{ github.event_name == 'pull_request_target' }}