From e4b5bc576f57d7447816a1a3df388534b28ece5e Mon Sep 17 00:00:00 2001 From: kele-leanes Date: Thu, 30 Nov 2023 16:42:16 -0300 Subject: [PATCH] Fix canMessage function in XMTPModule and update test case --- .../main/java/expo/modules/xmtpreactnativesdk/XMTPModule.kt | 4 ++-- example/src/tests.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/android/src/main/java/expo/modules/xmtpreactnativesdk/XMTPModule.kt b/android/src/main/java/expo/modules/xmtpreactnativesdk/XMTPModule.kt index ae439262b..1fc8f4a3b 100644 --- a/android/src/main/java/expo/modules/xmtpreactnativesdk/XMTPModule.kt +++ b/android/src/main/java/expo/modules/xmtpreactnativesdk/XMTPModule.kt @@ -218,8 +218,8 @@ class XMTPModule : Module() { try { logV("staticCanMessage") val options = ClientOptions(api = apiEnvironments(environment, appVersion)) - Client.canMessage(peerAddress = peerAddress, options = options) - true + val canMessage = Client.canMessage(peerAddress = peerAddress, options = options) + canMessage } catch (e: Exception) { throw XMTPException("Failed to create client: $e") } diff --git a/example/src/tests.ts b/example/src/tests.ts index 20d41ae9f..4bcef4c77 100644 --- a/example/src/tests.ts +++ b/example/src/tests.ts @@ -623,7 +623,7 @@ test("canManagePreferences", async () => { test("is address in the XMTP network", async () => { const alix = await XMTP.Client.createRandom({ env: "local" }); - const isAddressAvailable = await XMTP.publicCanMessage(alix.address, 'local'); + const isAddressAvailable = await XMTP.staticCanMessage(alix.address, 'local'); return isAddressAvailable });