@@ -168,6 +168,22 @@ class PeerTest : EclairTestSuite() {
168168 newPeers(this , Pair (alice0.staticParams.nodeParams, bob0.staticParams.nodeParams), Pair (TestConstants .Alice .walletParams, TestConstants .Bob .walletParams), listOf (alice0 to bob0))
169169 }
170170
171+ @Test
172+ fun `invoice parameters` () = runSuspendTest {
173+ val nodeParams = TestConstants .Alice .nodeParams
174+ val walletParams = TestConstants .Alice .walletParams
175+ val bob = newPeer(nodeParams, walletParams)
176+
177+ run {
178+ val deferredInvoice = CompletableDeferred <PaymentRequest >()
179+ bob.send(ReceivePayment (randomBytes32(), 1 .msat, " A description: \uD83D\uDE2C " , 3600 * 3 , deferredInvoice))
180+ val invoice = deferredInvoice.await()
181+ assertEquals(1 .msat, invoice.amount)
182+ assertEquals(3600 * 3 , invoice.expirySeconds)
183+ assertEquals(" A description: \uD83D\uDE2C " , invoice.description)
184+ }
185+ }
186+
171187 @Test
172188 fun `invoice routing hints` () = runSuspendTest {
173189 val (alice0, bob0) = TestsHelper .reachNormal()
@@ -181,7 +197,7 @@ class PeerTest : EclairTestSuite() {
181197
182198 run {
183199 val deferredInvoice = CompletableDeferred <PaymentRequest >()
184- bob.send(ReceivePayment (randomBytes32(), 15_000_000 .msat, " default routing hints" , deferredInvoice))
200+ bob.send(ReceivePayment (randomBytes32(), 15_000_000 .msat, " default routing hints" , null , deferredInvoice))
185201 val invoice = deferredInvoice.await()
186202 // The routing hint uses default values since no channel update has been sent by Alice yet.
187203 assertEquals(1 , invoice.routingInfo.size)
@@ -194,7 +210,7 @@ class PeerTest : EclairTestSuite() {
194210 bob.forward(aliceUpdate)
195211
196212 val deferredInvoice = CompletableDeferred <PaymentRequest >()
197- bob.send(ReceivePayment (randomBytes32(), 5_000_000 .msat, " updated routing hints" , deferredInvoice))
213+ bob.send(ReceivePayment (randomBytes32(), 5_000_000 .msat, " updated routing hints" , null , deferredInvoice))
198214 val invoice = deferredInvoice.await()
199215 // The routing hint uses values from Alice's channel update.
200216 assertEquals(1 , invoice.routingInfo.size)
@@ -218,7 +234,7 @@ class PeerTest : EclairTestSuite() {
218234 val (alice, bob, alice2bob, bob2alice) = newPeers(this , nodeParams, walletParams, listOf (alice0 to bob0), automateMessaging = false )
219235
220236 val deferredInvoice = CompletableDeferred <PaymentRequest >()
221- bob.send(ReceivePayment (randomBytes32(), 15_000_000 .msat, " test invoice" , deferredInvoice))
237+ bob.send(ReceivePayment (randomBytes32(), 15_000_000 .msat, " test invoice" , null , deferredInvoice))
222238 val invoice = deferredInvoice.await()
223239
224240 alice.send(SendPayment (UUID .randomUUID(), invoice.amount!! , alice.remoteNodeId, OutgoingPayment .Details .Normal (invoice)))
@@ -264,7 +280,7 @@ class PeerTest : EclairTestSuite() {
264280 val (alice, bob) = newPeers(this , nodeParams, walletParams, listOf (alice0 to bob0))
265281
266282 val deferredInvoice = CompletableDeferred <PaymentRequest >()
267- bob.send(ReceivePayment (randomBytes32(), 15_000_000 .msat, " test invoice" , deferredInvoice))
283+ bob.send(ReceivePayment (randomBytes32(), 15_000_000 .msat, " test invoice" , null , deferredInvoice))
268284 val invoice = deferredInvoice.await()
269285
270286 alice.send(SendPayment (UUID .randomUUID(), invoice.amount!! , alice.remoteNodeId, OutgoingPayment .Details .Normal (invoice)))
0 commit comments