]> git.bitcoin.ninja Git - ldk-java/commitdiff
Skip methods we can't use anyway
authorMatt Corallo <git@bluematt.me>
Tue, 13 Oct 2020 20:23:59 +0000 (16:23 -0400)
committerMatt Corallo <git@bluematt.me>
Tue, 13 Oct 2020 20:23:59 +0000 (16:23 -0400)
genbindings.py
src/main/java/org/ldk/structs/ChannelDetails.java
src/main/java/org/ldk/structs/ChannelInfo.java
src/main/java/org/ldk/structs/ChannelMessageHandler.java
src/main/java/org/ldk/structs/NetGraphMsgHandler.java
src/main/java/org/ldk/structs/NodeAnnouncementInfo.java
src/main/java/org/ldk/structs/NodeInfo.java
src/main/java/org/ldk/structs/PeerManager.java
src/main/java/org/ldk/structs/RouteHop.java
src/main/java/org/ldk/structs/UnsignedChannelAnnouncement.java
src/main/java/org/ldk/structs/UnsignedNodeAnnouncement.java

index d2cf50db00938836c97e5964ada92e317446e484..93b3e77df816c02ed584e049ec7a5bac74cd2ec6 100755 (executable)
@@ -409,6 +409,8 @@ with open(sys.argv[1]) as in_h, open(sys.argv[2], "w") as out_java, open(sys.arg
                 if not arg_conv_info.rust_obj in trait_structs and not arg_conv_info.rust_obj in unitary_enums:
                     print(re_match.group(2) + " bad - " + arg_conv_info.rust_obj)
                     args_known = False
+            if arg_conv_info.arg_conv is not None and "Warning" in arg_conv_info.arg_conv:
+                args_known = False
             arg_names.append(arg_conv_info)
 
         out_java_struct = None
@@ -807,6 +809,7 @@ with open(sys.argv[1]) as in_h, open(sys.argv[2], "w") as out_java, open(sys.arg
                 elif fn_line.group(2) == "free":
                     out_c.write("\t\t.free = " + struct_name + "_JCalls_free,\n")
                 else:
+                    clone_fns.add(struct_name + "_clone")
                     out_c.write("\t\t.clone = " + struct_name + "_JCalls_clone,\n")
             for var_line in field_var_lines:
                 if var_line.group(1) in trait_structs:
index 740cb20c1a4f6f0cefe84c04b7575381166affda..35107dd52aed84bd78f6490c1e94115a47747b22 100644 (file)
@@ -43,12 +43,7 @@ public class ChannelDetails extends CommonBase {
                return ret;
        }
 
-       public void set_counterparty_features(ChannelDetails this_ptr, InitFeatures val) {
-               bindings.ChannelDetails_set_counterparty_features(this_ptr == null ? 0 : this_ptr.ptr & ~1, val == null ? 0 : val.ptr & ~1);
-               this.ptrs_to.add(this_ptr);
-               this.ptrs_to.add(val);
-       }
-
+       // Skipped ChannelDetails_set_counterparty_features
        public long get_channel_value_satoshis(ChannelDetails this_ptr) {
                long ret = bindings.ChannelDetails_get_channel_value_satoshis(this_ptr == null ? 0 : this_ptr.ptr & ~1);
                this.ptrs_to.add(this_ptr);
index 67537203842af2cf7dfcd5b5769a7a35d1e34ccf..b0de8cbede3f1c43d5372b065f58777e294dde28 100644 (file)
@@ -16,12 +16,7 @@ public class ChannelInfo extends CommonBase {
                return ret;
        }
 
-       public void set_features(ChannelInfo this_ptr, ChannelFeatures val) {
-               bindings.ChannelInfo_set_features(this_ptr == null ? 0 : this_ptr.ptr & ~1, val == null ? 0 : val.ptr & ~1);
-               this.ptrs_to.add(this_ptr);
-               this.ptrs_to.add(val);
-       }
-
+       // Skipped ChannelInfo_set_features
        public byte[] get_node_one(ChannelInfo this_ptr) {
                byte[] ret = bindings.ChannelInfo_get_node_one(this_ptr == null ? 0 : this_ptr.ptr & ~1);
                this.ptrs_to.add(this_ptr);
@@ -39,12 +34,7 @@ public class ChannelInfo extends CommonBase {
                return ret;
        }
 
-       public void set_one_to_two(ChannelInfo this_ptr, DirectionalChannelInfo val) {
-               bindings.ChannelInfo_set_one_to_two(this_ptr == null ? 0 : this_ptr.ptr & ~1, val == null ? 0 : val.ptr & ~1);
-               this.ptrs_to.add(this_ptr);
-               this.ptrs_to.add(val);
-       }
-
+       // Skipped ChannelInfo_set_one_to_two
        public byte[] get_node_two(ChannelInfo this_ptr) {
                byte[] ret = bindings.ChannelInfo_get_node_two(this_ptr == null ? 0 : this_ptr.ptr & ~1);
                this.ptrs_to.add(this_ptr);
@@ -62,12 +52,7 @@ public class ChannelInfo extends CommonBase {
                return ret;
        }
 
-       public void set_two_to_one(ChannelInfo this_ptr, DirectionalChannelInfo val) {
-               bindings.ChannelInfo_set_two_to_one(this_ptr == null ? 0 : this_ptr.ptr & ~1, val == null ? 0 : val.ptr & ~1);
-               this.ptrs_to.add(this_ptr);
-               this.ptrs_to.add(val);
-       }
-
+       // Skipped ChannelInfo_set_two_to_one
        public ChannelAnnouncement get_announcement_message(ChannelInfo this_ptr) {
                ChannelAnnouncement ret = new ChannelAnnouncement(null, bindings.ChannelInfo_get_announcement_message(this_ptr == null ? 0 : this_ptr.ptr & ~1));
                this.ptrs_to.add(this_ptr);
index a981ecab48e354f70a0b6d11e574fbafe53a7253..bce27276060283794ad75d329cfccced346eaebf 100644 (file)
@@ -15,18 +15,8 @@ public class ChannelMessageHandler extends CommonBase {
                bindings.ChannelMessageHandler_free(ptr); super.finalize();
        }
 
-       public void call_handle_open_channel(byte[] their_node_id, InitFeatures their_features, OpenChannel msg) {
-               bindings.ChannelMessageHandler_call_handle_open_channel(this.ptr, their_node_id, their_features == null ? 0 : their_features.ptr & ~1, msg == null ? 0 : msg.ptr & ~1);
-               this.ptrs_to.add(their_features);
-               this.ptrs_to.add(msg);
-       }
-
-       public void call_handle_accept_channel(byte[] their_node_id, InitFeatures their_features, AcceptChannel msg) {
-               bindings.ChannelMessageHandler_call_handle_accept_channel(this.ptr, their_node_id, their_features == null ? 0 : their_features.ptr & ~1, msg == null ? 0 : msg.ptr & ~1);
-               this.ptrs_to.add(their_features);
-               this.ptrs_to.add(msg);
-       }
-
+       // Skipped ChannelMessageHandler_call_handle_open_channel
+       // Skipped ChannelMessageHandler_call_handle_accept_channel
        public void call_handle_funding_created(byte[] their_node_id, FundingCreated msg) {
                bindings.ChannelMessageHandler_call_handle_funding_created(this.ptr, their_node_id, msg == null ? 0 : msg.ptr & ~1);
                this.ptrs_to.add(msg);
index 02dfafc3fd7e62d3b9cd7c105e24ea822c244b07..b475109ba49f0606076ee892464e090a41c31bd7 100644 (file)
@@ -16,13 +16,7 @@ public class NetGraphMsgHandler extends CommonBase {
                this.ptrs_to.add(logger);
        }
 
-       public NetGraphMsgHandler(Access chain_access, Logger logger, NetworkGraph network_graph) {
-               super(bindings.NetGraphMsgHandler_from_net_graph(chain_access == null ? 0 : chain_access.ptr, logger == null ? 0 : logger.ptr, network_graph == null ? 0 : network_graph.ptr & ~1));
-               this.ptrs_to.add(chain_access);
-               this.ptrs_to.add(logger);
-               this.ptrs_to.add(network_graph);
-       }
-
+       // Skipped NetGraphMsgHandler_from_net_graph
        public LockedNetworkGraph read_locked_graph() {
                LockedNetworkGraph ret = new LockedNetworkGraph(null, bindings.NetGraphMsgHandler_read_locked_graph(this.ptr));
                return ret;
index 2f55d6732b9ce902d77e486ab2ecb8a12c6c54f2..fe13f99f74c39bb0e84072ac494ecf7d68f69817 100644 (file)
@@ -16,12 +16,7 @@ public class NodeAnnouncementInfo extends CommonBase {
                return ret;
        }
 
-       public void set_features(NodeAnnouncementInfo this_ptr, NodeFeatures val) {
-               bindings.NodeAnnouncementInfo_set_features(this_ptr == null ? 0 : this_ptr.ptr & ~1, val == null ? 0 : val.ptr & ~1);
-               this.ptrs_to.add(this_ptr);
-               this.ptrs_to.add(val);
-       }
-
+       // Skipped NodeAnnouncementInfo_set_features
        public int get_last_update(NodeAnnouncementInfo this_ptr) {
                int ret = bindings.NodeAnnouncementInfo_get_last_update(this_ptr == null ? 0 : this_ptr.ptr & ~1);
                this.ptrs_to.add(this_ptr);
index e76ff9e760e5223a9ad435dc6ed7542d9f0a2284..acfc3c4cfc5de955be637754487e4c96c0801ad2 100644 (file)
@@ -29,12 +29,7 @@ public class NodeInfo extends CommonBase {
                return ret;
        }
 
-       public void set_announcement_info(NodeInfo this_ptr, NodeAnnouncementInfo val) {
-               bindings.NodeInfo_set_announcement_info(this_ptr == null ? 0 : this_ptr.ptr & ~1, val == null ? 0 : val.ptr & ~1);
-               this.ptrs_to.add(this_ptr);
-               this.ptrs_to.add(val);
-       }
-
+       // Skipped NodeInfo_set_announcement_info
        // Skipped NodeInfo_new
        // Skipped NodeInfo_write
        public NodeInfo(byte[] ser) {
index 62e50eed05e8853356e668ddba78dbaccf411aa1..d225690023ccd3ae6b3383d2b85cd33d0330581e 100644 (file)
@@ -10,12 +10,7 @@ public class PeerManager extends CommonBase {
                bindings.PeerManager_free(ptr); super.finalize();
        }
 
-       public PeerManager(MessageHandler message_handler, byte[] our_node_secret, byte[] ephemeral_random_data, Logger logger) {
-               super(bindings.PeerManager_new(message_handler == null ? 0 : message_handler.ptr & ~1, our_node_secret, ephemeral_random_data, logger == null ? 0 : logger.ptr));
-               this.ptrs_to.add(message_handler);
-               this.ptrs_to.add(logger);
-       }
-
+       // Skipped PeerManager_new
        // Skipped PeerManager_get_peer_node_ids
        // Skipped PeerManager_new_outbound_connection
        // Skipped PeerManager_new_inbound_connection
index 54210f7ceb682211cf988b6962b2ec18692f7d79..814ebe5a73dd55ccacd27419e371ae53ac44f1b7 100644 (file)
@@ -32,12 +32,7 @@ public class RouteHop extends CommonBase {
                return ret;
        }
 
-       public void set_node_features(RouteHop this_ptr, NodeFeatures val) {
-               bindings.RouteHop_set_node_features(this_ptr == null ? 0 : this_ptr.ptr & ~1, val == null ? 0 : val.ptr & ~1);
-               this.ptrs_to.add(this_ptr);
-               this.ptrs_to.add(val);
-       }
-
+       // Skipped RouteHop_set_node_features
        public long get_short_channel_id(RouteHop this_ptr) {
                long ret = bindings.RouteHop_get_short_channel_id(this_ptr == null ? 0 : this_ptr.ptr & ~1);
                this.ptrs_to.add(this_ptr);
@@ -55,12 +50,7 @@ public class RouteHop extends CommonBase {
                return ret;
        }
 
-       public void set_channel_features(RouteHop this_ptr, ChannelFeatures val) {
-               bindings.RouteHop_set_channel_features(this_ptr == null ? 0 : this_ptr.ptr & ~1, val == null ? 0 : val.ptr & ~1);
-               this.ptrs_to.add(this_ptr);
-               this.ptrs_to.add(val);
-       }
-
+       // Skipped RouteHop_set_channel_features
        public long get_fee_msat(RouteHop this_ptr) {
                long ret = bindings.RouteHop_get_fee_msat(this_ptr == null ? 0 : this_ptr.ptr & ~1);
                this.ptrs_to.add(this_ptr);
@@ -83,10 +73,5 @@ public class RouteHop extends CommonBase {
                this.ptrs_to.add(this_ptr);
        }
 
-       public RouteHop(byte[] pubkey_arg, NodeFeatures node_features_arg, long short_channel_id_arg, ChannelFeatures channel_features_arg, long fee_msat_arg, int cltv_expiry_delta_arg) {
-               super(bindings.RouteHop_new(pubkey_arg, node_features_arg == null ? 0 : node_features_arg.ptr & ~1, short_channel_id_arg, channel_features_arg == null ? 0 : channel_features_arg.ptr & ~1, fee_msat_arg, cltv_expiry_delta_arg));
-               this.ptrs_to.add(node_features_arg);
-               this.ptrs_to.add(channel_features_arg);
-       }
-
+       // Skipped RouteHop_new
 }
index 2d80ea4c06a5bc7007bf1b4d7d26560e137c02d8..7af521468be8d32d318b08241c7696c1b45c6beb 100644 (file)
@@ -21,12 +21,7 @@ public class UnsignedChannelAnnouncement extends CommonBase {
                return ret;
        }
 
-       public void set_features(UnsignedChannelAnnouncement this_ptr, ChannelFeatures val) {
-               bindings.UnsignedChannelAnnouncement_set_features(this_ptr == null ? 0 : this_ptr.ptr & ~1, val == null ? 0 : val.ptr & ~1);
-               this.ptrs_to.add(this_ptr);
-               this.ptrs_to.add(val);
-       }
-
+       // Skipped UnsignedChannelAnnouncement_set_features
        public byte[] get_chain_hash(UnsignedChannelAnnouncement this_ptr) {
                byte[] ret = bindings.UnsignedChannelAnnouncement_get_chain_hash(this_ptr == null ? 0 : this_ptr.ptr & ~1);
                this.ptrs_to.add(this_ptr);
index 828432ec2c6685c23c3f020e83ccb3caf7c8954c..3a20d82091d4118f0690b0b9e23b85fcd3df4e1c 100644 (file)
@@ -21,12 +21,7 @@ public class UnsignedNodeAnnouncement extends CommonBase {
                return ret;
        }
 
-       public void set_features(UnsignedNodeAnnouncement this_ptr, NodeFeatures val) {
-               bindings.UnsignedNodeAnnouncement_set_features(this_ptr == null ? 0 : this_ptr.ptr & ~1, val == null ? 0 : val.ptr & ~1);
-               this.ptrs_to.add(this_ptr);
-               this.ptrs_to.add(val);
-       }
-
+       // Skipped UnsignedNodeAnnouncement_set_features
        public int get_timestamp(UnsignedNodeAnnouncement this_ptr) {
                int ret = bindings.UnsignedNodeAnnouncement_get_timestamp(this_ptr == null ? 0 : this_ptr.ptr & ~1);
                this.ptrs_to.add(this_ptr);