Skip fewer fn's, support trait-contained objects
[ldk-java] / src / main / java / org / ldk / structs / InMemoryChannelKeys.java
index 00825ab32738701ba8132c24aa0b6b7f6a08a6da..0644fb59b715caf1aeefbdbf7206e68fa20d9b9f 100644 (file)
@@ -11,7 +11,7 @@ public class InMemoryChannelKeys extends CommonBase {
        @Override @SuppressWarnings("deprecation")
        protected void finalize() throws Throwable {
                super.finalize();
-               bindings.InMemoryChannelKeys_free(ptr);
+               if (ptr != 0) { bindings.InMemoryChannelKeys_free(ptr); }
        }
 
        public static InMemoryChannelKeys constructor_clone(InMemoryChannelKeys orig) {
@@ -75,7 +75,12 @@ public class InMemoryChannelKeys extends CommonBase {
                bindings.InMemoryChannelKeys_set_commitment_seed(this.ptr, val);
        }
 
-       // Skipped InMemoryChannelKeys_new
+       public static InMemoryChannelKeys constructor_new(byte[] funding_key, byte[] revocation_base_key, byte[] payment_key, byte[] delayed_payment_base_key, byte[] htlc_base_key, byte[] commitment_seed, long channel_value_satoshis, TwoTuple<Long, Long> key_derivation_params) {
+               long ret = bindings.InMemoryChannelKeys_new(funding_key, revocation_base_key, payment_key, delayed_payment_base_key, htlc_base_key, commitment_seed, channel_value_satoshis, bindings.C2Tuple_u64u64Z_new(key_derivation_params.a, key_derivation_params.b));
+               InMemoryChannelKeys ret_hu_conv = new InMemoryChannelKeys(null, ret);
+               return ret_hu_conv;
+       }
+
        public ChannelPublicKeys counterparty_pubkeys() {
                long ret = bindings.InMemoryChannelKeys_counterparty_pubkeys(this.ptr);
                ChannelPublicKeys ret_hu_conv = new ChannelPublicKeys(null, ret);