Skip to content

Commit bc6343b

Browse files
committed
Merge branch 'np/bump-latest-rust' of https://github.com/xmtp/xmtp-android into np/v2-stream-updates
2 parents 7e16d6c + ec9b1e6 commit bc6343b

22 files changed

+726
-209
lines changed

library/src/androidTest/java/org/xmtp/android/library/AttachmentTest.kt

+7-4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package org.xmtp.android.library
22

33
import androidx.test.ext.junit.runners.AndroidJUnit4
44
import com.google.protobuf.kotlin.toByteStringUtf8
5+
import kotlinx.coroutines.runBlocking
56
import org.junit.Assert.assertEquals
67
import org.junit.Test
78
import org.junit.runner.RunWith
@@ -27,10 +28,12 @@ class AttachmentTest {
2728
val aliceConversation =
2829
aliceClient.conversations.newConversation(fixtures.bob.walletAddress)
2930

30-
aliceConversation.send(
31-
content = attachment,
32-
options = SendOptions(contentType = ContentTypeAttachment),
33-
)
31+
runBlocking {
32+
aliceConversation.send(
33+
content = attachment,
34+
options = SendOptions(contentType = ContentTypeAttachment),
35+
)
36+
}
3437
val messages = aliceConversation.messages()
3538
assertEquals(messages.size, 1)
3639
if (messages.size == 1) {

library/src/androidTest/java/org/xmtp/android/library/CodecTest.kt

+25-16
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package org.xmtp.android.library
22

33
import androidx.test.ext.junit.runners.AndroidJUnit4
44
import com.google.protobuf.kotlin.toByteStringUtf8
5+
import kotlinx.coroutines.runBlocking
56
import org.junit.Assert.assertEquals
67
import org.junit.Assert.assertTrue
78
import org.junit.Test
@@ -60,10 +61,12 @@ class CodecTest {
6061
val aliceClient = fixtures.aliceClient
6162
val aliceConversation =
6263
aliceClient.conversations.newConversation(fixtures.bob.walletAddress)
63-
aliceConversation.send(
64-
content = 3.14,
65-
options = SendOptions(contentType = NumberCodec().contentType),
66-
)
64+
runBlocking {
65+
aliceConversation.send(
66+
content = 3.14,
67+
options = SendOptions(contentType = NumberCodec().contentType),
68+
)
69+
}
6770
val messages = aliceConversation.messages()
6871
assertEquals(messages.size, 1)
6972
if (messages.size == 1) {
@@ -82,10 +85,12 @@ class CodecTest {
8285
aliceClient.conversations.newConversation(fixtures.bob.walletAddress)
8386
val textContent = TextCodec().encode(content = "hiya")
8487
val source = DecodedComposite(encodedContent = textContent)
85-
aliceConversation.send(
86-
content = source,
87-
options = SendOptions(contentType = CompositeCodec().contentType),
88-
)
88+
runBlocking {
89+
aliceConversation.send(
90+
content = source,
91+
options = SendOptions(contentType = CompositeCodec().contentType),
92+
)
93+
}
8994
val messages = aliceConversation.messages()
9095
val decoded: DecodedComposite? = messages[0].content()
9196
assertEquals("hiya", decoded?.content())
@@ -107,10 +112,12 @@ class CodecTest {
107112
DecodedComposite(parts = listOf(DecodedComposite(encodedContent = numberContent))),
108113
),
109114
)
110-
aliceConversation.send(
111-
content = source,
112-
options = SendOptions(contentType = CompositeCodec().contentType),
113-
)
115+
runBlocking {
116+
aliceConversation.send(
117+
content = source,
118+
options = SendOptions(contentType = CompositeCodec().contentType),
119+
)
120+
}
114121
val messages = aliceConversation.messages()
115122
val decoded: DecodedComposite? = messages[0].content()
116123
val part1 = decoded!!.parts[0]
@@ -127,10 +134,12 @@ class CodecTest {
127134
val aliceClient = fixtures.aliceClient!!
128135
val aliceConversation =
129136
aliceClient.conversations.newConversation(fixtures.bob.walletAddress)
130-
aliceConversation.send(
131-
content = 3.14,
132-
options = SendOptions(contentType = codec.contentType),
133-
)
137+
runBlocking {
138+
aliceConversation.send(
139+
content = 3.14,
140+
options = SendOptions(contentType = codec.contentType),
141+
)
142+
}
134143
val messages = aliceConversation.messages()
135144
assert(messages.isNotEmpty())
136145

0 commit comments

Comments
 (0)