Solving all problems with Quartz tests
This commit is contained in:
-49
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user