Skip to content

Commit

Permalink
add static can message
Browse files Browse the repository at this point in the history
  • Loading branch information
nplasterer committed Dec 4, 2024
1 parent 9c63104 commit e580e1a
Showing 1 changed file with 27 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,33 @@ class ClientTest {
assertEquals(inboxId, client.inboxId)
}

@Test
fun testStaticCanMessage() {
val context = InstrumentationRegistry.getInstrumentation().targetContext
val fixtures = fixtures()
val notOnNetwork = PrivateKeyBuilder()

val canMessageList = runBlocking {
Client.canMessage(
listOf(
fixtures.alix.walletAddress,
notOnNetwork.address,
fixtures.bo.walletAddress
), context, ClientOptions.Api(XMTPEnvironment.LOCAL, false)
)
}

val expectedResults = mapOf(
fixtures.alix.walletAddress.lowercase() to true,
notOnNetwork.address.lowercase() to false,
fixtures.bo.walletAddress.lowercase() to true
)

expectedResults.forEach { (address, expected) ->
assertEquals(expected, canMessageList[address.lowercase()])
}
}

@Test
fun testCanDeleteDatabase() {
val key = SecureRandom().generateSeed(32)
Expand Down

0 comments on commit e580e1a

Please sign in to comment.