Skip to content

Commit

Permalink
fix up the tests
Browse files Browse the repository at this point in the history
  • Loading branch information
nplasterer committed Sep 16, 2024
1 parent b68cb66 commit db3495d
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 15 deletions.
24 changes: 12 additions & 12 deletions library/src/androidTest/java/org/xmtp/android/library/ClientTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ class ClientTest {
fun testHasPrivateKeyBundleV1() {
val fakeWallet = PrivateKeyBuilder()
val client = runBlocking { Client().create(account = fakeWallet) }
assertEquals(1, client.privateKeyBundleV1.preKeysList?.size)
val preKey = client.privateKeyBundleV1.preKeysList?.get(0)
assertEquals(1, client.v1keys.preKeysList?.size)
val preKey = client.v1keys.preKeysList?.get(0)
assert(preKey?.publicKey?.hasSignature() ?: false)
}

Expand All @@ -56,12 +56,12 @@ class ClientTest {
val clientFromV1Bundle = runBlocking { Client().buildFromBundle(bundle) }
assertEquals(client.address, clientFromV1Bundle.address)
assertEquals(
client.privateKeyBundleV1.identityKey,
clientFromV1Bundle.privateKeyBundleV1.identityKey,
client.v1keys.identityKey,
clientFromV1Bundle.v1keys.identityKey,
)
assertEquals(
client.privateKeyBundleV1.preKeysList,
clientFromV1Bundle.privateKeyBundleV1.preKeysList,
client.v1keys.preKeysList,
clientFromV1Bundle.v1keys.preKeysList,
)
}

Expand All @@ -73,12 +73,12 @@ class ClientTest {
val clientFromV1Bundle = runBlocking { Client().buildFromV1Bundle(bundleV1) }
assertEquals(client.address, clientFromV1Bundle.address)
assertEquals(
client.privateKeyBundleV1.identityKey,
clientFromV1Bundle.privateKeyBundleV1.identityKey,
client.v1keys.identityKey,
clientFromV1Bundle.v1keys.identityKey,
)
assertEquals(
client.privateKeyBundleV1.preKeysList,
clientFromV1Bundle.privateKeyBundleV1.preKeysList,
client.v1keys.preKeysList,
clientFromV1Bundle.v1keys.preKeysList,
)
}

Expand Down Expand Up @@ -107,8 +107,8 @@ class ClientTest {
}
assertEquals(client.address, clientFromV1Bundle.address)
assertEquals(
client.privateKeyBundleV1.identityKey,
clientFromV1Bundle.privateKeyBundleV1.identityKey,
client.v1keys.identityKey,
clientFromV1Bundle.v1keys.identityKey,
)

runBlocking {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class ConversationsTest {
val newWallet = PrivateKeyBuilder()
val newClient = runBlocking { Client().create(account = newWallet) }
val message = MessageV1Builder.buildEncode(
sender = newClient.privateKeyBundleV1,
sender = newClient.v1keys,
recipient = fixtures.aliceClient.v1keys.toPublicKeyBundle(),
message = TextCodec().encode(content = "hello").toByteArray(),
timestamp = created
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ class LocalInstrumentedTest {
private fun publishLegacyContact(client: Client) {
val contactBundle = Contact.ContactBundle.newBuilder().also {
it.v1 = it.v1.toBuilder().apply {
keyBundle = client.privateKeyBundleV1.toPublicKeyBundle()
keyBundle = client.v1keys.toPublicKeyBundle()
}.build()
}.build()
val envelope = Envelope.newBuilder().also {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ data class Fixtures(
fun publishLegacyContact(client: Client) {
val contactBundle = ContactBundle.newBuilder().also { builder ->
builder.v1 = builder.v1.toBuilder().also {
it.keyBundle = client.privateKeyBundleV1.toPublicKeyBundle()
it.keyBundle = client.v1keys.toPublicKeyBundle()
}.build()
}.build()
val envelope = Envelope.newBuilder().apply {
Expand Down

0 comments on commit db3495d

Please sign in to comment.