X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;ds=sidebyside;f=gen_type_mapping.py;h=2ed6faa375f9d70ebbdbd985495a66e7c9dbc1a6;hb=4f95adad9cbb821f489d89f73d3e493933ba60fe;hp=0f2babf063690f50611db2ae53ba6c0d87f7e047;hpb=41fd4b2fbfdaf80ed7f44df6fd4d6f64b9fc8997;p=ldk-java diff --git a/gen_type_mapping.py b/gen_type_mapping.py index 0f2babf0..2ed6faa3 100644 --- a/gen_type_mapping.py +++ b/gen_type_mapping.py @@ -504,10 +504,10 @@ 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 = ("0", "")) - if ty_info.rust_obj == "LDKu5": + if ty_info.rust_obj == "LDKu5" or ty_info.rust_obj == "LDKWitnessVersion": assert from_hu_conv is None return ConvInfo(ty_info = ty_info, arg_name = ty_info.var_name, - arg_conv = "", arg_conv_name = "(LDKu5){ ._0 = " + ty_info.var_name + " }", arg_conv_cleanup = None, + arg_conv = "", arg_conv_name = "(" + ty_info.rust_obj + "){ ._0 = " + ty_info.var_name + " }", arg_conv_cleanup = None, ret_conv = ("uint8_t " + ty_info.var_name + "_val = ", "._0;"), ret_conv_name = ty_info.var_name + "_val", 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()", ""))