Skip to content

Commit

Permalink
Fixed unit tests build
Browse files Browse the repository at this point in the history
  • Loading branch information
André Vants committed Jun 29, 2022
1 parent 6b52b41 commit 39ddac5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions Tests/RelayerTests/IridiumRelayTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class IridiumRelayTests: XCTestCase {
let message = "qwerty"
let subscriptionId = "sub-id"
let subscriptionParams = RelayJSONRPC.SubscriptionParams(id: subscriptionId, data: RelayJSONRPC.SubscriptionData(topic: topic, message: message))
let subscriptionRequest = JSONRPCRequest<RelayJSONRPC.SubscriptionParams>(id: 12345, method: RelayJSONRPC.Method.subscription.rawValue, params: subscriptionParams)
let subscriptionRequest = JSONRPCRequest<RelayJSONRPC.SubscriptionParams>(id: 12345, method: RelayJSONRPC.Method.subscription.method, params: subscriptionParams)
iridiumRelay.onMessage = { subscriptionTopic, subscriptionMessage in
XCTAssertEqual(subscriptionMessage, message)
XCTAssertEqual(subscriptionTopic, topic)
Expand All @@ -37,7 +37,7 @@ class IridiumRelayTests: XCTestCase {

func testPublishRequestAcknowledge() {
let acknowledgeExpectation = expectation(description: "completion with no error on iridium request acknowledge after publish")
let requestId = iridiumRelay.publish(topic: "", payload: "{}", onNetworkAcknowledge: { error in
let requestId = iridiumRelay.publish(topic: "", payload: "{}", tag: .unknown, onNetworkAcknowledge: { error in
acknowledgeExpectation.fulfill()
XCTAssertNil(error)
})
Expand Down Expand Up @@ -72,7 +72,7 @@ class IridiumRelayTests: XCTestCase {
}

func testSendOnPublish() {
iridiumRelay.publish(topic: "", payload: "", onNetworkAcknowledge: { _ in})
iridiumRelay.publish(topic: "", payload: "", tag: .unknown, onNetworkAcknowledge: { _ in})
XCTAssertTrue(dispatcher.sent)
}

Expand Down
4 changes: 2 additions & 2 deletions Tests/WalletConnectSignTests/Mocks/MockedRelayClient.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ class MockedRelayClient: NetworkRelaying {
socketConnectionStatusPublisherSubject.eraseToAnyPublisher()
}

func publish(topic: String, payload: String, prompt: Bool) async throws {
func publish(topic: String, payload: String, tag: PublishTag, prompt: Bool) async throws {
self.prompt = prompt
}

var onMessage: ((String, String) -> Void)?
var error: Error?
var prompt = false
func publish(topic: String, payload: String, prompt: Bool, onNetworkAcknowledge: @escaping ((Error?) -> Void)) -> Int64 {
func publish(topic: String, payload: String, tag: PublishTag, prompt: Bool, onNetworkAcknowledge: @escaping ((Error?) -> Void)) -> Int64 {
self.prompt = prompt
onNetworkAcknowledge(error)
return 0
Expand Down

0 comments on commit 39ddac5

Please sign in to comment.