Skip to content

Commit

Permalink
Fixing the giftWrap test cases since the migration to v2
Browse files Browse the repository at this point in the history
  • Loading branch information
vitorpamplona committed Jan 5, 2024
1 parent eaaa9a6 commit 7143d78
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}

Expand All @@ -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
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()))
}
}

Expand All @@ -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) })
Expand All @@ -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()))
}
}

Expand All @@ -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) })
Expand Down

0 comments on commit 7143d78

Please sign in to comment.