From de28908caacda7226bac70837a33cfe6e16417ab Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Tue, 13 Oct 2020 16:23:59 -0400 Subject: [PATCH] Skip methods we can't use anyway --- genbindings.py | 3 +++ .../java/org/ldk/structs/ChannelDetails.java | 7 +------ .../java/org/ldk/structs/ChannelInfo.java | 21 +++---------------- .../ldk/structs/ChannelMessageHandler.java | 14 ++----------- .../org/ldk/structs/NetGraphMsgHandler.java | 8 +------ .../org/ldk/structs/NodeAnnouncementInfo.java | 7 +------ src/main/java/org/ldk/structs/NodeInfo.java | 7 +------ .../java/org/ldk/structs/PeerManager.java | 7 +------ src/main/java/org/ldk/structs/RouteHop.java | 21 +++---------------- .../structs/UnsignedChannelAnnouncement.java | 7 +------ .../ldk/structs/UnsignedNodeAnnouncement.java | 7 +------ 11 files changed, 18 insertions(+), 91 deletions(-) diff --git a/genbindings.py b/genbindings.py index d2cf50db..93b3e77d 100755 --- a/genbindings.py +++ b/genbindings.py @@ -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: diff --git a/src/main/java/org/ldk/structs/ChannelDetails.java b/src/main/java/org/ldk/structs/ChannelDetails.java index 740cb20c..35107dd5 100644 --- a/src/main/java/org/ldk/structs/ChannelDetails.java +++ b/src/main/java/org/ldk/structs/ChannelDetails.java @@ -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); diff --git a/src/main/java/org/ldk/structs/ChannelInfo.java b/src/main/java/org/ldk/structs/ChannelInfo.java index 67537203..b0de8cbe 100644 --- a/src/main/java/org/ldk/structs/ChannelInfo.java +++ b/src/main/java/org/ldk/structs/ChannelInfo.java @@ -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); diff --git a/src/main/java/org/ldk/structs/ChannelMessageHandler.java b/src/main/java/org/ldk/structs/ChannelMessageHandler.java index a981ecab..bce27276 100644 --- a/src/main/java/org/ldk/structs/ChannelMessageHandler.java +++ b/src/main/java/org/ldk/structs/ChannelMessageHandler.java @@ -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); diff --git a/src/main/java/org/ldk/structs/NetGraphMsgHandler.java b/src/main/java/org/ldk/structs/NetGraphMsgHandler.java index 02dfafc3..b475109b 100644 --- a/src/main/java/org/ldk/structs/NetGraphMsgHandler.java +++ b/src/main/java/org/ldk/structs/NetGraphMsgHandler.java @@ -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; diff --git a/src/main/java/org/ldk/structs/NodeAnnouncementInfo.java b/src/main/java/org/ldk/structs/NodeAnnouncementInfo.java index 2f55d673..fe13f99f 100644 --- a/src/main/java/org/ldk/structs/NodeAnnouncementInfo.java +++ b/src/main/java/org/ldk/structs/NodeAnnouncementInfo.java @@ -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); diff --git a/src/main/java/org/ldk/structs/NodeInfo.java b/src/main/java/org/ldk/structs/NodeInfo.java index e76ff9e7..acfc3c4c 100644 --- a/src/main/java/org/ldk/structs/NodeInfo.java +++ b/src/main/java/org/ldk/structs/NodeInfo.java @@ -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) { diff --git a/src/main/java/org/ldk/structs/PeerManager.java b/src/main/java/org/ldk/structs/PeerManager.java index 62e50eed..d2256900 100644 --- a/src/main/java/org/ldk/structs/PeerManager.java +++ b/src/main/java/org/ldk/structs/PeerManager.java @@ -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 diff --git a/src/main/java/org/ldk/structs/RouteHop.java b/src/main/java/org/ldk/structs/RouteHop.java index 54210f7c..814ebe5a 100644 --- a/src/main/java/org/ldk/structs/RouteHop.java +++ b/src/main/java/org/ldk/structs/RouteHop.java @@ -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 } diff --git a/src/main/java/org/ldk/structs/UnsignedChannelAnnouncement.java b/src/main/java/org/ldk/structs/UnsignedChannelAnnouncement.java index 2d80ea4c..7af52146 100644 --- a/src/main/java/org/ldk/structs/UnsignedChannelAnnouncement.java +++ b/src/main/java/org/ldk/structs/UnsignedChannelAnnouncement.java @@ -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); diff --git a/src/main/java/org/ldk/structs/UnsignedNodeAnnouncement.java b/src/main/java/org/ldk/structs/UnsignedNodeAnnouncement.java index 828432ec..3a20d820 100644 --- a/src/main/java/org/ldk/structs/UnsignedNodeAnnouncement.java +++ b/src/main/java/org/ldk/structs/UnsignedNodeAnnouncement.java @@ -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); -- 2.39.5