Skip to content

Commit

Permalink
check klint
Browse files Browse the repository at this point in the history
  • Loading branch information
humanagent committed Dec 31, 2023
1 parent 224a102 commit b5ff78b
Showing 1 changed file with 3 additions and 18 deletions.
Original file line number Diff line number Diff line change
@@ -1,22 +1,12 @@
package org.xmtp.android.library

import com.google.protobuf.kotlin.toByteStringUtf8
import org.junit.Assert.assertEquals
import org.junit.Assert.assertNotNull
import org.json.JSONObject
import org.junit.Assert.assertEquals
import org.junit.Test
import android.util.Log
import org.xmtp.android.library.messages.PrivateKeyBuilder
import org.xmtp.android.library.messages.UnsignedPublicKey
import org.xmtp.android.library.messages.generate
import org.xmtp.android.library.messages.getPublicKeyBundle
import org.xmtp.android.library.messages.toPublicKeyBundle
import org.xmtp.android.library.messages.toV2
import org.xmtp.proto.message.contents.PrivateKeyOuterClass

import org.xmtp.android.library.codecs.ContentCodec
import org.xmtp.android.library.codecs.ContentTypeId
import org.xmtp.android.library.codecs.ContentTypeIdBuilder
import org.xmtp.android.library.codecs.ContentCodec
import org.xmtp.android.library.codecs.EncodedContent
import org.xmtp.android.library.messages.walletAddress

Expand All @@ -39,7 +29,7 @@ data class MultiplyNumberCodec(
it.content = jsonObject.toString().toByteStringUtf8()
}.build()
}

override fun decode(content: EncodedContent): NumberPair {
val jsonObject = JSONObject(content.content.toStringUtf8())
val a = jsonObject.getDouble("a")
Expand All @@ -53,11 +43,7 @@ data class MultiplyNumberCodec(
}
}


class Test {



@Test
fun testSendingAndReceivingMultipliedNumber() {
Client.register(codec = MultiplyNumberCodec())
Expand All @@ -74,7 +60,6 @@ class Test {
assertEquals(messages.size, 1)
if (messages.size == 1) {
val content: NumberPair? = messages[0].content()

assertEquals(6.0, content?.result)
}
}
Expand Down

0 comments on commit b5ff78b

Please sign in to comment.