Skip to content

Commit

Permalink
fix platform tests
Browse files Browse the repository at this point in the history
  • Loading branch information
llbartekll committed Dec 19, 2024
1 parent 6a4abe0 commit e8a5b17
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ final class XPlatformW3WTests: XCTestCase {
signClient: signClient,
pairingClient: pairingClient,
pushClient: PushClientMock(),
config: WalletKit.Config(crypto: DefaultCryptoProvider(), pimlicoApiKey: nil))
config: WalletKit.Config(crypto: DefaultCryptoProvider(), pimlicoApiKey: nil),
projectId: InputConfig.projectId)
}

func testSessionSettle() async throws {
Expand Down
24 changes: 24 additions & 0 deletions Sources/ReownWalletKit/WalletKitClientFactory.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,28 @@ struct WalletKitClientFactory {
chainAbstractionClient: chainAbstractionClient
)
}

#if DEBUG
static func create(
signClient: SignClientProtocol,
pairingClient: PairingClientProtocol,
pushClient: PushClientProtocol,
config: WalletKit.Config,
projectId: String
) -> WalletKitClient {
var safesManager: SafesManager? = nil
if let pimlicoApiKey = config.pimlicoApiKey {
safesManager = SafesManager(pimlicoApiKey: pimlicoApiKey)
}
let chainAbstractionClient = ChainAbstractionClient(projectId: projectId)
return WalletKitClient(
signClient: signClient,
pairingClient: pairingClient,
pushClient: pushClient,
smartAccountsManager: safesManager,
chainAbstractionClient: chainAbstractionClient
)
}
#endif

}

0 comments on commit e8a5b17

Please sign in to comment.