]> git.bitcoin.ninja Git - ldk-c-bindings/commitdiff
Update C++ demo to new upstream changes
authorMatt Corallo <git@bluematt.me>
Sat, 7 Aug 2021 21:07:55 +0000 (21:07 +0000)
committerMatt Corallo <git@bluematt.me>
Sat, 7 Aug 2021 21:07:55 +0000 (21:07 +0000)
lightning-c-bindings/demo.cpp

index b71edc324581052dc102f17d3a0dcbe331a055f2..b2a8f925706d2473a5f4fed173b8d3d4a8cd60c5 100644 (file)
@@ -637,9 +637,11 @@ int main() {
                        assert(queue.events.size() == 1);
                        assert(queue.events[0]->tag == LDKEvent_PaymentReceived);
                        assert(!memcmp(queue.events[0]->payment_received.payment_hash.data, payment_hash.data, 32));
-                       assert(!memcmp(queue.events[0]->payment_received.payment_secret.data, Invoice_payment_secret(invoice->contents.result).data, 32));
+                       assert(queue.events[0]->payment_received.purpose.tag == LDKPaymentPurpose_InvoicePayment);
+                       assert(!memcmp(queue.events[0]->payment_received.purpose.invoice_payment.payment_secret.data,
+                                       Invoice_payment_secret(invoice->contents.result).data, 32));
                        assert(queue.events[0]->payment_received.amt == 5000);
-                       memcpy(payment_preimage.data, queue.events[0]->payment_received.payment_preimage.data, 32);
+                       memcpy(payment_preimage.data, queue.events[0]->payment_received.purpose.invoice_payment.payment_preimage.data, 32);
                        assert(ChannelManager_claim_funds(&cm2, payment_preimage));
                }
                PeerManager_process_events(&net2);