]> git.bitcoin.ninja Git - ldk-java/commitdiff
Add an accessor to UInt5 to get the value and correct conversion
authorMatt Corallo <git@bluematt.me>
Sat, 7 Aug 2021 17:57:02 +0000 (17:57 +0000)
committerMatt Corallo <git@bluematt.me>
Mon, 9 Aug 2021 05:53:31 +0000 (05:53 +0000)
gen_type_mapping.py
src/main/java/org/ldk/util/UInt5.java

index 9fcdc402f998c476ffadd07d73265ef3fa20256a..6cf389aac46ff049e668154a9ba0bc96661fe1e2 100644 (file)
@@ -412,7 +412,7 @@ class TypeMappingGenerator:
                         arg_conv = "", arg_conv_name = "(LDKu5){ ._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 = 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 + ".ptr", ""))
+                        to_hu_conv_name = ty_info.var_name + "_conv", from_hu_conv = (ty_info.var_name + ".getVal()", ""))
 
                 assert ty_info.rust_obj == "LDKTxOut"
                 if not ty_info.is_ptr and not holds_ref:
index 1bd627b88b77781628907371a4b703e936dfdbf5..a818d9d81a820293f15aad127f78688be957d36c 100644 (file)
@@ -11,4 +11,11 @@ public class UInt5 {
         }
         this.val = val;
     }
+
+    /**
+     * @return the value represented
+     */
+    public byte getVal() {
+        return val;
+    }
 }