mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2025-11-10 11:47:24 +01:00
Fixing the giftWrap test cases since the migration to v2
This commit is contained in:
@@ -129,14 +129,14 @@ class GiftWrapBenchmark {
|
|||||||
@Test
|
@Test
|
||||||
fun tinyMessageHardCoded() {
|
fun tinyMessageHardCoded() {
|
||||||
benchmarkRule.measureRepeated {
|
benchmarkRule.measureRepeated {
|
||||||
basePerformanceTest("Hola, que tal?", 2946)
|
basePerformanceTest("Hola, que tal?", 3402)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun regularMessageHardCoded() {
|
fun regularMessageHardCoded() {
|
||||||
benchmarkRule.measureRepeated {
|
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 {
|
benchmarkRule.measureRepeated {
|
||||||
basePerformanceTest(
|
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. ",
|
"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)
|
val wrap = createWrap(sender, receiver)
|
||||||
|
|
||||||
benchmarkRule.measureRepeated {
|
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 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 {
|
benchmarkRule.measureRepeated {
|
||||||
assertNotNull(innerJson?.let { Event.fromJson(it) })
|
assertNotNull(innerJson?.let { Event.fromJson(it) })
|
||||||
@@ -170,7 +170,7 @@ class GiftWrapReceivingBenchmark {
|
|||||||
val seal = createSeal(sender, receiver)
|
val seal = createSeal(sender, receiver)
|
||||||
|
|
||||||
benchmarkRule.measureRepeated {
|
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 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 {
|
benchmarkRule.measureRepeated {
|
||||||
assertNotNull(innerJson?.let { Gossip.fromJson(it) })
|
assertNotNull(innerJson?.let { Gossip.fromJson(it) })
|
||||||
|
|||||||
Reference in New Issue
Block a user