Skip to content

Commit

Permalink
Merge pull request #907 from WalletConnect/fix-testEndToEndPayload
Browse files Browse the repository at this point in the history
fix testEndToEndPayload
  • Loading branch information
llbartekll authored Jun 14, 2023
2 parents 4c86fd6 + c118701 commit 75b0a8d
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions Example/RelayIntegrationTests/RelayClientEndToEndTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -101,18 +101,23 @@ final class RelayClientEndToEndTests: XCTestCase {

relayB.messagePublisher.sink { topic, payload, _ in
(subscriptionBTopic, subscriptionBPayload) = (topic, payload)
Task(priority: .high) {
sleep(1)
try await relayB.publish(topic: randomTopic, payload: payloadB, tag: 0, prompt: false, ttl: 60)
}
expectationB.fulfill()
}.store(in: &publishers)

relayA.socketConnectionStatusPublisher.sink { _ in
relayA.socketConnectionStatusPublisher.sink { status in
guard status == .connected else {return}
Task(priority: .high) {
try await relayA.publish(topic: randomTopic, payload: payloadA, tag: 0, prompt: false, ttl: 60)
try await relayA.subscribe(topic: randomTopic)
try await relayA.publish(topic: randomTopic, payload: payloadA, tag: 0, prompt: false, ttl: 60)
}
}.store(in: &publishers)
relayB.socketConnectionStatusPublisher.sink { _ in
relayB.socketConnectionStatusPublisher.sink { status in
guard status == .connected else {return}
Task(priority: .high) {
try await relayB.publish(topic: randomTopic, payload: payloadB, tag: 0, prompt: false, ttl: 60)
try await relayB.subscribe(topic: randomTopic)
}
}.store(in: &publishers)
Expand Down

0 comments on commit 75b0a8d

Please sign in to comment.