]> git.bitcoin.ninja Git - ldk-java/commitdiff
Update tests and batteries to new result API
authorMatt Corallo <git@bluematt.me>
Tue, 4 Jan 2022 22:52:11 +0000 (22:52 +0000)
committerMatt Corallo <git@bluematt.me>
Wed, 5 Jan 2022 06:35:03 +0000 (06:35 +0000)
src/main/java/org/ldk/batteries/NioPeerHandler.java
src/test/java/org/ldk/PeerTest.java

index 53a5353c2738f5ac4f0f0b1e9e471269b2e50196..e0dd83e9edc570b542716ae88caacb4e45b58940 100644 (file)
@@ -219,7 +219,7 @@ public class NioPeerHandler {
                                     long read_result_pointer = bindings.PeerManager_read_event(
                                             peer_manager_raw_pointer, peer.descriptor_raw_pointer, read_bytes);
                                     if (bindings.CResult_boolPeerHandleErrorZ_is_ok(read_result_pointer)) {
-                                        if (bindings.LDKCResult_boolPeerHandleErrorZ_get_ok(read_result_pointer)) {
+                                        if (bindings.CResult_boolPeerHandleErrorZ_get_ok(read_result_pointer)) {
                                             key.interestOps(key.interestOps() & (~SelectionKey.OP_READ));
                                         }
                                     } else {
index cc51260d6bf46a748688517bb19ea6cd0c3b68db..929787f48b18b7dd4d1bd676d8cb1b64332b261f 100644 (file)
@@ -217,7 +217,7 @@ public class PeerTest {
         long con_res = bindings.PeerManager_new_inbound_connection(peer2.peer_manager, descriptor2);
         assert(bindings.CResult_NonePeerHandleErrorZ_is_ok(con_res));
         bindings.CResult_NonePeerHandleErrorZ_free(con_res);
-        do_read_event(list, peer2.peer_manager, descriptor2, bindings.LDKCResult_CVec_u8ZPeerHandleErrorZ_get_ok(init_vec));
+        do_read_event(list, peer2.peer_manager, descriptor2, bindings.CResult_CVec_u8ZPeerHandleErrorZ_get_ok(init_vec));
         bindings.CResult_CVec_u8ZPeerHandleErrorZ_free(init_vec);
 
         deliver_peer_messages(list, peer1.peer_manager, peer2.peer_manager);
@@ -276,7 +276,7 @@ public class PeerTest {
         long no_min_val = bindings.COption_u64Z_none();
         long inbound_payment = bindings.ChannelManager_create_inbound_payment(peer2.chan_manager, no_min_val, 7200);
         assert bindings.CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_is_ok(inbound_payment);
-        long payment_tuple = bindings.LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_get_ok(inbound_payment);
+        long payment_tuple = bindings.CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_get_ok(inbound_payment);
         bindings.COption_u64Z_free(no_min_val);
         long scorer = bindings.Scorer_default();
         long scorer_interface = bindings.Scorer_as_Score(scorer);
@@ -296,7 +296,7 @@ public class PeerTest {
 
         for (long chan : peer1_chans) bindings.ChannelDetails_free(chan);
         assert bindings.CResult_RouteLightningErrorZ_is_ok(route);
-        long payment_res = bindings.ChannelManager_send_payment(peer1.chan_manager, bindings.LDKCResult_RouteLightningErrorZ_get_ok(route),
+        long payment_res = bindings.ChannelManager_send_payment(peer1.chan_manager, bindings.CResult_RouteLightningErrorZ_get_ok(route),
                 bindings.C2Tuple_PaymentHashPaymentSecretZ_get_a(payment_tuple), bindings.C2Tuple_PaymentHashPaymentSecretZ_get_b(payment_tuple));
         bindings.CResult_RouteLightningErrorZ_free(route);
         bindings.CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_is_ok(inbound_payment);