Solving all problems with Quartz tests

This commit is contained in:
Vitor Pamplona
2026-03-16 19:22:28 -04:00
parent 962da3280b
commit 56cce46858
5 changed files with 258 additions and 50 deletions
@@ -86,29 +86,6 @@ class LnZapPaymentRequestEventTest {
assertNull(event.encryptionScheme())
}
@Test
fun testCreateRequestWithNip44() =
runTest {
val clientKeyPair = KeyPair()
val walletKeyPair = KeyPair()
val clientSigner = NostrSignerInternal(clientKeyPair)
val walletServicePubkey: HexKey =
walletKeyPair.pubKey.toHexKey()
val request = GetBalanceMethod.create()
val event =
LnZapPaymentRequestEvent.createRequest(
request = request,
walletServicePubkey = walletServicePubkey,
signer = clientSigner,
createdAt = 1000L,
useNip44 = true,
)
assertEquals(23194, event.kind)
assertEquals("nip44_v2", event.encryptionScheme())
}
@Test
fun testDecryptPayInvoiceRequest() =
runTest {
@@ -156,32 +133,6 @@ class LnZapPaymentRequestEventTest {
assertEquals("test payment", decrypted.params?.description)
}
@Test
fun testDecryptNip44Request() =
runTest {
val clientKeyPair = KeyPair()
val walletKeyPair = KeyPair()
val clientSigner = NostrSignerInternal(clientKeyPair)
val walletSigner = NostrSignerInternal(walletKeyPair)
val walletServicePubkey: HexKey =
walletKeyPair.pubKey.toHexKey()
val request = GetInfoMethod.create()
val event =
LnZapPaymentRequestEvent.createRequest(
request = request,
walletServicePubkey = walletServicePubkey,
signer = clientSigner,
useNip44 = true,
)
assertEquals("nip44_v2", event.encryptionScheme())
// Wallet service should be able to decrypt NIP-44 encrypted request
val decrypted = event.decryptRequest(walletSigner)
assertIs<GetInfoMethod>(decrypted)
}
@Test
fun testCanDecrypt() =
runTest {