feat: add a wrapper hash to track home diff util changes for wrapper contact recipient info, add test for dirty state in double set

This commit is contained in:
0x330a
2023-05-23 17:46:54 +10:00
parent 1781d7e85f
commit 01fef6a0a4
15 changed files with 136 additions and 21 deletions

View File

@@ -47,6 +47,22 @@ class InstrumentedTests {
assertArrayEquals(kp.secretKey.take(32).toByteArray(), seed)
}
@Test
private fun testDirtyEmptyString() {
val contacts = Contacts.newInstance(keyPair.secretKey)
val definitelyRealId = "050000000000000000000000000000000000000000000000000000000000000000"
val contact = contacts.getOrConstruct(definitelyRealId)
contacts.set(contact)
assertTrue(contacts.dirty())
contacts.set(contact.copy(name = "test"))
assertTrue(contacts.dirty())
val push = contacts.push()
contacts.confirmPushed(push.seqNo, "abc123")
contacts.set(contact.copy(name = "test2"))
contacts.set(contact.copy(name = "test"))
assertFalse(contacts.dirty())
}
@Test
fun jni_contacts() {
val contacts = Contacts.newInstance(keyPair.secretKey)