From: Matt Corallo Date: Fri, 6 Aug 2021 19:09:10 +0000 (+0000) Subject: Update tests to latest upstream master X-Git-Tag: v0.0.100.0~1 X-Git-Url: http://git.bitcoin.ninja/?a=commitdiff_plain;h=71dc550b6cbe873f4c03f6fed165f8498e7aa842;p=ldk-java Update tests to latest upstream master --- diff --git a/src/test/java/org/ldk/HumanObjectPeerTest.java b/src/test/java/org/ldk/HumanObjectPeerTest.java index f903c3fb..74cae4f6 100644 --- a/src/test/java/org/ldk/HumanObjectPeerTest.java +++ b/src/test/java/org/ldk/HumanObjectPeerTest.java @@ -41,7 +41,7 @@ class HumanObjectPeerTestInstance { return KeysInterface.new_impl(new KeysInterface.KeysInterfaceInterface() { @Override public byte[] get_node_secret() { return underlying_if.get_node_secret(); } @Override public byte[] get_destination_script() { return underlying_if.get_destination_script(); } - @Override public byte[] get_shutdown_pubkey() { return underlying_if.get_shutdown_pubkey(); } + @Override public ShutdownScript get_shutdown_scriptpubkey() { return underlying_if.get_shutdown_scriptpubkey(); } @Override public Sign get_channel_signer(boolean inbound, long channel_value_satoshis) { @@ -762,7 +762,8 @@ class HumanObjectPeerTestInstance { events = state.peer2.get_manager_events(1, state.peer1, state.peer2); assert events[0] instanceof Event.PaymentReceived; - byte[] payment_preimage = ((Event.PaymentReceived)events[0]).payment_preimage; + assert ((Event.PaymentReceived)events[0]).purpose instanceof PaymentPurpose.InvoicePayment; + byte[] payment_preimage = ((PaymentPurpose.InvoicePayment)((Event.PaymentReceived)events[0]).purpose).payment_preimage; assert !Arrays.equals(payment_preimage, new byte[32]); state.peer2.chan_manager.claim_funds(payment_preimage); diff --git a/src/test/java/org/ldk/PeerTest.java b/src/test/java/org/ldk/PeerTest.java index a05c899f..de96a8bf 100644 --- a/src/test/java/org/ldk/PeerTest.java +++ b/src/test/java/org/ldk/PeerTest.java @@ -302,7 +302,9 @@ public class PeerTest { assert events.size() == 1; bindings.LDKEvent payment_recvd = bindings.LDKEvent_ref_from_ptr(events.get(0)); assert payment_recvd instanceof bindings.LDKEvent.PaymentReceived; - assert bindings.ChannelManager_claim_funds(peer2.chan_manager, ((bindings.LDKEvent.PaymentReceived) payment_recvd).payment_preimage); + bindings.LDKPaymentPurpose purpose = bindings.LDKPaymentPurpose_ref_from_ptr(((bindings.LDKEvent.PaymentReceived) payment_recvd).purpose); + assert purpose instanceof bindings.LDKPaymentPurpose.InvoicePayment; + assert bindings.ChannelManager_claim_funds(peer2.chan_manager, ((bindings.LDKPaymentPurpose.InvoicePayment) purpose).payment_preimage); bindings.Event_free(events.remove(0)); deliver_peer_messages(list, peer1.peer_manager, peer2.peer_manager);