Fixing the giftWrap test cases since the migration to v2

This commit is contained in:
Vitor Pamplona 2024-01-05 15:18:46 -05:00
parent eaaa9a6446
commit 7143d78663
2 changed files with 7 additions and 7 deletions
benchmark/src/androidTest/java/com/vitorpamplona/amethyst/benchmark

@ -129,14 +129,14 @@ class GiftWrapBenchmark {
@Test
fun tinyMessageHardCoded() {
benchmarkRule.measureRepeated {
basePerformanceTest("Hola, que tal?", 2946)
basePerformanceTest("Hola, que tal?", 3402)
}
}
@Test
fun regularMessageHardCoded() {
benchmarkRule.measureRepeated {
basePerformanceTest("Hi, honey, can you drop by the market and get some bread?", 3098)
basePerformanceTest("Hi, honey, can you drop by the market and get some bread?", 3746)
}
}
@ -145,7 +145,7 @@ class GiftWrapBenchmark {
benchmarkRule.measureRepeated {
basePerformanceTest(
"My queen, you are nothing short of royalty to me. You possess more beauty in the nail of your pinkie toe than everything else in this world combined. I am astounded by your grace, generosity, and graciousness. I am so lucky to know you. ",
3738
5114
)
}
}

@ -144,7 +144,7 @@ class GiftWrapReceivingBenchmark {
val wrap = createWrap(sender, receiver)
benchmarkRule.measureRepeated {
assertNotNull(CryptoUtils.decryptNIP44v1(wrap.content, sender.keyPair.privKey!!, wrap.pubKey.hexToByteArray()))
assertNotNull(CryptoUtils.decryptNIP44v2(wrap.content, receiver.keyPair.privKey!!, wrap.pubKey.hexToByteArray()))
}
}
@ -155,7 +155,7 @@ class GiftWrapReceivingBenchmark {
val wrap = createWrap(sender, receiver)
val innerJson = CryptoUtils.decryptNIP44v1(wrap.content, receiver.keyPair.privKey!!, wrap.pubKey.hexToByteArray())
val innerJson = CryptoUtils.decryptNIP44v2(wrap.content, receiver.keyPair.privKey!!, wrap.pubKey.hexToByteArray())
benchmarkRule.measureRepeated {
assertNotNull(innerJson?.let { Event.fromJson(it) })
@ -170,7 +170,7 @@ class GiftWrapReceivingBenchmark {
val seal = createSeal(sender, receiver)
benchmarkRule.measureRepeated {
assertNotNull(CryptoUtils.decryptNIP44v1(seal.content, sender.keyPair.privKey!!, seal.pubKey.hexToByteArray()))
assertNotNull(CryptoUtils.decryptNIP44v2(seal.content, receiver.keyPair.privKey!!, seal.pubKey.hexToByteArray()))
}
}
@ -181,7 +181,7 @@ class GiftWrapReceivingBenchmark {
val seal = createSeal(sender, receiver)
val innerJson = CryptoUtils.decryptNIP44v1(seal.content, receiver.keyPair.privKey!!, seal.pubKey.hexToByteArray())
val innerJson = CryptoUtils.decryptNIP44v2(seal.content, receiver.keyPair.privKey!!, seal.pubKey.hexToByteArray())
benchmarkRule.measureRepeated {
assertNotNull(innerJson?.let { Gossip.fromJson(it) })