From 0783f0f67fa01826613b207baa40dc50a0f970cf Mon Sep 17 00:00:00 2001 From: Bartosz Rozwarski Date: Fri, 1 Dec 2023 13:20:43 +0100 Subject: [PATCH] fix tests build --- .../WalletConnectPairingTests/WalletPairServiceTests.swift | 2 +- Tests/Web3WalletTests/Mocks/PairingClientMock.swift | 6 ++++++ Tests/Web3WalletTests/Mocks/SignClientMock.swift | 5 +++++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/Tests/WalletConnectPairingTests/WalletPairServiceTests.swift b/Tests/WalletConnectPairingTests/WalletPairServiceTests.swift index 4f88e9c94..5483d669c 100644 --- a/Tests/WalletConnectPairingTests/WalletPairServiceTests.swift +++ b/Tests/WalletConnectPairingTests/WalletPairServiceTests.swift @@ -18,7 +18,7 @@ final class WalletPairServiceTestsTests: XCTestCase { storageMock = WCPairingStorageMock() cryptoMock = KeyManagementServiceMock() rpcHistory = RPCHistoryFactory.createForNetwork(keyValueStorage: RuntimeKeyValueStorage()) - service = WalletPairService(networkingInteractor: networkingInteractor, kms: cryptoMock, pairingStorage: storageMock, history: rpcHistory) + service = WalletPairService(networkingInteractor: networkingInteractor, kms: cryptoMock, pairingStorage: storageMock, history: rpcHistory, logger: ConsoleLoggerMock()) } func testPairWhenNetworkNotConnectedThrows() async { diff --git a/Tests/Web3WalletTests/Mocks/PairingClientMock.swift b/Tests/Web3WalletTests/Mocks/PairingClientMock.swift index 562e01ef5..edf3f1390 100644 --- a/Tests/Web3WalletTests/Mocks/PairingClientMock.swift +++ b/Tests/Web3WalletTests/Mocks/PairingClientMock.swift @@ -4,6 +4,12 @@ import Combine @testable import WalletConnectPairing final class PairingClientMock: PairingClientProtocol { + private var logsSubject = PassthroughSubject() + + var logsPublisher: AnyPublisher { + return logsSubject.eraseToAnyPublisher() + } + var pairCalled = false var disconnectPairingCalled = false diff --git a/Tests/Web3WalletTests/Mocks/SignClientMock.swift b/Tests/Web3WalletTests/Mocks/SignClientMock.swift index e14d222c4..de4b3cb22 100644 --- a/Tests/Web3WalletTests/Mocks/SignClientMock.swift +++ b/Tests/Web3WalletTests/Mocks/SignClientMock.swift @@ -4,6 +4,11 @@ import Combine @testable import WalletConnectSign final class SignClientMock: SignClientProtocol { + private var logsSubject = PassthroughSubject() + + var logsPublisher: AnyPublisher { + return logsSubject.eraseToAnyPublisher() + } var approveCalled = false var rejectCalled = false var updateCalled = false