Renames Gossip to Rumor to match names on the NIP-59

This commit is contained in:
Vitor Pamplona
2025-01-15 08:58:08 -05:00
parent d1c64a0d15
commit f3b049382e
17 changed files with 152 additions and 152 deletions
@@ -30,7 +30,7 @@ import com.vitorpamplona.quartz.nip01Core.core.Event
import com.vitorpamplona.quartz.nip01Core.signers.NostrSignerInternal
import com.vitorpamplona.quartz.nip17Dm.NIP17Factory
import com.vitorpamplona.quartz.nip59Giftwrap.GiftWrapEvent
import com.vitorpamplona.quartz.nip59Giftwrap.SealedGossipEvent
import com.vitorpamplona.quartz.nip59Giftwrap.SealedRumorEvent
import junit.framework.TestCase
import org.junit.Assert
import org.junit.Assert.assertTrue
@@ -89,8 +89,8 @@ class GiftWrapBenchmark {
it.cachedGift(keyToUse) { event ->
event.checkSignature()
if (event is SealedGossipEvent) {
event.cachedGossip(keyToUse) { innerData ->
if (event is SealedRumorEvent) {
event.cachedRumor(keyToUse) { innerData ->
Assert.assertEquals(message, innerData.content)
countDownLatch2.countDown()
}
@@ -135,8 +135,8 @@ class GiftWrapBenchmark {
wrap.cachedGift(keyToUse) { seal ->
seal.checkSignature()
if (seal is SealedGossipEvent) {
seal.cachedGossip(keyToUse) { innerData ->
if (seal is SealedRumorEvent) {
seal.cachedRumor(keyToUse) { innerData ->
Assert.assertEquals(message, innerData.content)
counter.countDown()
}
@@ -33,8 +33,8 @@ import com.vitorpamplona.quartz.nip01Core.signers.NostrSigner
import com.vitorpamplona.quartz.nip01Core.signers.NostrSignerInternal
import com.vitorpamplona.quartz.nip17Dm.ChatMessageEvent
import com.vitorpamplona.quartz.nip59Giftwrap.GiftWrapEvent
import com.vitorpamplona.quartz.nip59Giftwrap.Gossip
import com.vitorpamplona.quartz.nip59Giftwrap.SealedGossipEvent
import com.vitorpamplona.quartz.nip59Giftwrap.Rumor
import com.vitorpamplona.quartz.nip59Giftwrap.SealedRumorEvent
import junit.framework.TestCase.assertNotNull
import junit.framework.TestCase.assertTrue
import org.junit.Rule
@@ -73,7 +73,7 @@ class GiftWrapReceivingBenchmark {
isDraft = true,
signer = sender,
) {
SealedGossipEvent.create(
SealedRumorEvent.create(
event = it,
encryptTo = receiver.pubKey,
signer = sender,
@@ -96,9 +96,9 @@ class GiftWrapReceivingBenchmark {
fun createSeal(
sender: NostrSigner,
receiver: NostrSigner,
): SealedGossipEvent {
): SealedRumorEvent {
val countDownLatch = CountDownLatch(1)
var seal: SealedGossipEvent? = null
var seal: SealedRumorEvent? = null
ChatMessageEvent.create(
msg = "Hi there! This is a test message",
@@ -113,7 +113,7 @@ class GiftWrapReceivingBenchmark {
isDraft = true,
signer = sender,
) {
SealedGossipEvent.create(
SealedRumorEvent.create(
event = it,
encryptTo = receiver.pubKey,
signer = sender,
@@ -225,6 +225,6 @@ class GiftWrapReceivingBenchmark {
seal.pubKey.hexToByteArray(),
)
benchmarkRule.measureRepeated { assertNotNull(innerJson?.let { Gossip.fromJson(it) }) }
benchmarkRule.measureRepeated { assertNotNull(innerJson?.let { Rumor.fromJson(it) }) }
}
}
@@ -27,7 +27,7 @@ import com.vitorpamplona.quartz.nip01Core.KeyPair
import com.vitorpamplona.quartz.nip01Core.signers.NostrSignerInternal
import com.vitorpamplona.quartz.nip17Dm.ChatMessageEvent
import com.vitorpamplona.quartz.nip59Giftwrap.GiftWrapEvent
import com.vitorpamplona.quartz.nip59Giftwrap.SealedGossipEvent
import com.vitorpamplona.quartz.nip59Giftwrap.SealedRumorEvent
import junit.framework.TestCase.assertTrue
import org.junit.Rule
import org.junit.Test
@@ -103,7 +103,7 @@ class GiftWrapSigningBenchmark {
benchmarkRule.measureRepeated {
val countDownLatch2 = CountDownLatch(1)
SealedGossipEvent.create(
SealedRumorEvent.create(
event = msg!!,
encryptTo = receiver.pubKey,
signer = sender,
@@ -122,7 +122,7 @@ class GiftWrapSigningBenchmark {
val countDownLatch = CountDownLatch(1)
var seal: SealedGossipEvent? = null
var seal: SealedRumorEvent? = null
ChatMessageEvent.create(
msg = "Hi there! This is a test message",
@@ -137,7 +137,7 @@ class GiftWrapSigningBenchmark {
isDraft = false,
signer = sender,
) {
SealedGossipEvent.create(
SealedRumorEvent.create(
event = it,
encryptTo = receiver.pubKey,
signer = sender,
@@ -183,7 +183,7 @@ class GiftWrapSigningBenchmark {
isDraft = false,
signer = sender,
) {
SealedGossipEvent.create(
SealedRumorEvent.create(
event = it,
encryptTo = receiver.pubKey,
signer = sender,