Add handling for manual `TxIn` and stop trying to clone `Witness`
[ldk-java] / gen_type_mapping.py
index 2a709ea46af9fcad29ee5064dfdc5a2abdbe544f..2dfdd6414e4d2e776af1f62357cf9fcc11a830e8 100644 (file)
@@ -500,7 +500,7 @@ class TypeMappingGenerator:
                         to_hu_conv = self.consts.var_decl_statement(ty_info.java_hu_ty, ty_info.var_name + "_hu_conv", "new " + ty_info.java_hu_ty + "(null, " + ty_info.var_name + ")") + ";" + to_hu_conv_sfx,
                         to_hu_conv_name = ty_info.var_name + "_hu_conv", from_hu_conv = from_hu_conv)
 
-                # The manually-defined types - TxOut, BigEndianScalar, U5, and Error
+                # The manually-defined types - TxIn, TxOut, BigEndianScalar, U5, and Error
                 if ty_info.rust_obj == "LDKError":
                     assert from_hu_conv is None
                     return ConvInfo(ty_info = ty_info, arg_name = ty_info.var_name,
@@ -517,7 +517,7 @@ class TypeMappingGenerator:
                         to_hu_conv = self.consts.var_decl_statement(ty_info.java_hu_ty, ty_info.var_name + "_conv", "new " + ty_info.java_hu_ty + "(" + ty_info.var_name + ")") + ";",
                         to_hu_conv_name = ty_info.var_name + "_conv", from_hu_conv = (ty_info.var_name + ".getVal()", ""))
 
-                assert ty_info.rust_obj == "LDKTxOut" or ty_info.rust_obj == "LDKBigEndianScalar"
+                assert ty_info.rust_obj == "LDKTxOut" or ty_info.rust_obj == "LDKTxIn" or ty_info.rust_obj == "LDKBigEndianScalar"
                 if not ty_info.is_ptr and not holds_ref:
                     ret_conv = (ty_info.rust_obj + "* " + ty_info.var_name + "_ref = MALLOC(sizeof(" + ty_info.rust_obj + "), \"" + ty_info.rust_obj + "\");\n*" + ty_info.var_name + "_ref = ", ";")
                     ret_conv_name = "tag_ptr(" + ty_info.var_name + "_ref, true)"