Skip to content

Commit

Permalink
Merge pull request #1120 from WalletConnect/develop
Browse files Browse the repository at this point in the history
1.8.1
  • Loading branch information
llbartekll committed Sep 19, 2023
2 parents 81fa22d + 4ffdfdc commit 1e7d7ba
Show file tree
Hide file tree
Showing 11 changed files with 38 additions and 12 deletions.
8 changes: 6 additions & 2 deletions .github/actions/run_tests_without_building/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ inputs:
gm-dapp-project-secret:
description: 'GM DApp Project Secret'
required: false
gm-dapp-host:
description: 'GM DApp Host'
required: false
default: 'gm.walletconnect.com'
js-client-api-host:
description: 'JS Client Api Host'
required: false
Expand Down Expand Up @@ -55,7 +59,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
Expand All @@ -73,7 +77,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'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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=gm.walletconnect.com JS_CLIENT_API_HOST=test-automation-api.walletconnect.com

# Relay Integration tests
- name: Run Relay integration tests
Expand Down
3 changes: 3 additions & 0 deletions Configuration.xcconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
8 changes: 7 additions & 1 deletion Example/ExampleApp.xcodeproj/IntegrationTests.xctestplan
Original file line number Diff line number Diff line change
Expand Up @@ -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)"
Expand Down Expand Up @@ -48,7 +52,9 @@
"skippedTests" : [
"AuthTests\/testEIP1271RespondSuccess()",
"ChatTests",
"ENSResolverTests"
"ENSResolverTests",
"SyncDerivationServiceTests",
"SyncTests"
],
"target" : {
"containerPath" : "container:ExampleApp.xcodeproj",
Expand Down
6 changes: 1 addition & 5 deletions Example/IntegrationTests/Push/NotifyTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ final class NotifyTests: XCTestCase {

var walletNotifyClientA: NotifyClient!

let gmDappDomain = "gm.walletconnect.com"
let gmDappDomain = InputConfig.gmDappHost

let pk = try! EthereumPrivateKey()

Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -188,9 +187,6 @@ final class NotifyTests: XCTestCase {
let subscribeExpectation = expectation(description: "creates notify subscription")
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)

Expand Down
8 changes: 8 additions & 0 deletions Example/IntegrationTests/Push/Publisher.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
4 changes: 4 additions & 0 deletions Example/Shared/Tests/InputConfig.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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")!
}
Expand Down
4 changes: 4 additions & 0 deletions NotifyTests.xctestplan
Original file line number Diff line number Diff line change
Expand Up @@ -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)"
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.8.0"}
{"version": "1.8.1"}
4 changes: 2 additions & 2 deletions Sources/WalletConnectUtils/Logger/ConsoleLogger.swift
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,8 @@ extension ConsoleLogger: ConsoleLogging {

#if DEBUG
public struct ConsoleLoggerMock: ConsoleLogging {
public var logsPublisher: AnyPublisher<WalletConnectUtils.Log, Never> {
return PassthroughSubject<WalletConnectUtils.Log, Never>().eraseToAnyPublisher()
public var logsPublisher: AnyPublisher<Log, Never> {
return PassthroughSubject<Log, Never>().eraseToAnyPublisher()
}

public init() {}
Expand Down
1 change: 1 addition & 0 deletions run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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_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"

Expand Down

0 comments on commit 1e7d7ba

Please sign in to comment.