Remove check in SignalCallLinkRecord.
This commit is contained in:
parent
85f92e509a
commit
58f820d640
2 changed files with 0 additions and 21 deletions
|
@ -8,7 +8,6 @@ package org.thoughtcrime.securesms.storage
|
|||
import okio.ByteString.Companion.EMPTY
|
||||
import okio.ByteString.Companion.toByteString
|
||||
import org.junit.Assert.assertFalse
|
||||
import org.junit.Assert.assertThrows
|
||||
import org.junit.BeforeClass
|
||||
import org.junit.Test
|
||||
import org.signal.core.util.logging.Log
|
||||
|
@ -74,20 +73,6 @@ class CallLinkRecordProcessorTest {
|
|||
assertFalse(result)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `Given a proto with both an admin pass key and a deletion timestamp, assert invalid`() {
|
||||
// GIVEN
|
||||
val proto = CallLinkRecord.Builder().apply {
|
||||
rootKey = mockCredentials.linkKeyBytes.toByteString()
|
||||
adminPasskey = mockCredentials.adminPassBytes!!.toByteString()
|
||||
deletedAtTimestampMs = System.currentTimeMillis()
|
||||
}.build()
|
||||
|
||||
assertThrows(IllegalStateException::class.java) {
|
||||
SignalCallLinkRecord(STORAGE_ID, proto)
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `Given a proto with neither an admin pass key nor a deletion timestamp, assert valid`() {
|
||||
// GIVEN
|
||||
|
|
|
@ -19,12 +19,6 @@ class SignalCallLinkRecord(private val id: StorageId, private val proto: CallLin
|
|||
val adminPassKey: ByteArray = proto.adminPasskey.toByteArray()
|
||||
val deletionTimestamp: Long = proto.deletedAtTimestampMs
|
||||
|
||||
init {
|
||||
if (deletionTimestamp != 0L && adminPassKey.isNotEmpty()) {
|
||||
throw IllegalStateException("Cannot have nonzero deletion timestamp ($deletionTimestamp) and admin passkey!")
|
||||
}
|
||||
}
|
||||
|
||||
fun toProto(): CallLinkRecord {
|
||||
return proto
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue