Skip to content

Commit e6ed8fd

Browse files
committed
fix tests
1 parent e378122 commit e6ed8fd

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

eclair-core/src/test/scala/fr/acinq/eclair/payment/Bolt12InvoiceSpec.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,7 @@ class Bolt12InvoiceSpec extends AnyFunSuite {
185185
val tlvs = Set[InvoiceTlv](
186186
InvoiceRequestMetadata(hex"012345"),
187187
OfferNodeId(nodeKey.publicKey),
188+
InvoiceRequestAmount(1684 msat),
188189
InvoiceRequestPayerId(randomKey().publicKey),
189190
InvoicePaths(Seq(createPaymentBlindedRoute(randomKey().publicKey).route)),
190191
InvoiceBlindedPay(Seq(PaymentInfo(0 msat, 0, CltvExpiryDelta(0), 0 msat, 765432 msat, Features.empty))),

eclair-core/src/test/scala/fr/acinq/eclair/wire/protocol/OfferTypesSpec.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,7 @@ class OfferTypesSpec extends AnyFunSuite {
122122
val request = InvoiceRequest(offer, 500 msat, 1, Features.empty, payerKey, Block.LivenetGenesisBlock.hash)
123123
assert(request.isValid)
124124
assert(request.offer == offer)
125-
val withoutAmount = signInvoiceRequest(request.copy(records = TlvStream(request.records.records.filter { case InvoiceRequestAmount(_) => false case _ => true })), payerKey)
126-
assert(!withoutAmount.isValid)
125+
assertThrows[Exception](signInvoiceRequest(request.copy(records = TlvStream(request.records.records.filter { case InvoiceRequestAmount(_) => false case _ => true })), payerKey))
127126
}
128127

129128
test("check that invoice request matches offer (chain compatibility)") {
@@ -188,11 +187,12 @@ class OfferTypesSpec extends AnyFunSuite {
188187
InvoiceRequestMetadata(hex"abcdef"),
189188
OfferNodeId(nodeId),
190189
InvoiceRequestPayerId(payerKey.publicKey),
190+
InvoiceRequestAmount(21000 msat)
191191
)
192192
val signature = signSchnorr(InvoiceRequest.signatureTag, rootHash(TlvStream[InvoiceRequestTlv](tlvsWithoutSignature), OfferCodecs.invoiceRequestTlvCodec), payerKey)
193193
val tlvs = tlvsWithoutSignature + Signature(signature)
194194
val invoiceRequest = InvoiceRequest(TlvStream(tlvs))
195-
val encoded = "lnr1qqp6hn00zcssxr0juddeytv7nwawhk9nq9us0arnk8j8wnsq8r2e86vzgtfneupetqssynwewhp70gwlp4chhm53g90jt9fpnx7rpmrzla3zd0nvxymm8e0p7pq06rwacy8756zgl3hdnsyfepq573astyz94rgn9uhxlyqj4gdyk6q8q0yrv6al909v3435amuvjqvkuq6k8fyld78r8srdyx7wnmwsdu"
195+
val encoded = "lnr1qqp6hn00zcssxr0juddeytv7nwawhk9nq9us0arnk8j8wnsq8r2e86vzgtfneupe2gp9yzzcyypymkt4c0n6rhcdw9a7ay2ptuje2gvehscwcchlvgntump3x7e7tc0sgp9k43qeu892gfnz2hrr7akh2x8erh7zm2tv52884vyl462dm5tfcahgtuzt7j0npy7getf4trv5d4g78a9fkwu3kke6hcxdr6t2n7vz"
196196
assert(InvoiceRequest.decode(encoded).get == invoiceRequest)
197197
assert(invoiceRequest.offer.amount.isEmpty)
198198
assert(invoiceRequest.offer.description.isEmpty)

0 commit comments

Comments
 (0)