Skip to content

Commit 1ed7566

Browse files
committed
Add an accessor to UInt5 to get the value and correct conversion
1 parent e7f34e7 commit 1ed7566

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

gen_type_mapping.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,7 @@ def map_type_with_info(self, ty_info, print_void, ret_arr_len, is_free, holds_re
412412
arg_conv = "", arg_conv_name = "(LDKu5){ ._0 = " + ty_info.var_name + " }", arg_conv_cleanup = None,
413413
ret_conv = ("uint8_t " + ty_info.var_name + "_val = ", "._0;"), ret_conv_name = ty_info.var_name + "_val",
414414
to_hu_conv = ty_info.java_hu_ty + " " + ty_info.var_name + "_conv = new " + ty_info.java_hu_ty + "(" + ty_info.var_name + ");",
415-
to_hu_conv_name = ty_info.var_name + "_conv", from_hu_conv = (ty_info.var_name + ".ptr", ""))
415+
to_hu_conv_name = ty_info.var_name + "_conv", from_hu_conv = (ty_info.var_name + ".getVal()", ""))
416416

417417
assert ty_info.rust_obj == "LDKTxOut"
418418
if not ty_info.is_ptr and not holds_ref:

src/main/java/org/ldk/util/UInt5.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,11 @@ public UInt5(byte val) {
1111
}
1212
this.val = val;
1313
}
14+
15+
/**
16+
* @return the value represented
17+
*/
18+
public byte getVal() {
19+
return val;
20+
}
1421
}

0 commit comments

Comments
 (0)