Skip to content

Commit 6ab8c07

Browse files
authored
Merge pull request #151 from aarani/fixStringArrayDecode
CSharp: fix LDKStr array decoding
2 parents cb6890a + dbcef74 commit 6ab8c07

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

c_sharp/src/org/ldk/structs/Bolt11Invoice.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ public string[] fallback_addresses() {
307307
int ret_conv_8_len = InternalUtils.getArrayLength(ret);
308308
string[] ret_conv_8_arr = new string[ret_conv_8_len];
309309
for (int i = 0; i < ret_conv_8_len; i++) {
310-
long ret_conv_8 = InternalUtils.getU32ArrayElem(ret, i);
310+
long ret_conv_8 = InternalUtils.getU64ArrayElem(ret, i);
311311
string ret_conv_8_conv = InternalUtils.decodeString(ret_conv_8);
312312
ret_conv_8_arr[i] = ret_conv_8_conv;
313313
}

c_sharp/src/org/ldk/structs/Result_CVec_StrZIOErrorZ.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ internal Result_CVec_StrZIOErrorZ_OK(object _dummy, long ptr) : base(_dummy, ptr
2525
int res_conv_8_len = InternalUtils.getArrayLength(res);
2626
string[] res_conv_8_arr = new string[res_conv_8_len];
2727
for (int i = 0; i < res_conv_8_len; i++) {
28-
long res_conv_8 = InternalUtils.getU32ArrayElem(res, i);
28+
long res_conv_8 = InternalUtils.getU64ArrayElem(res, i);
2929
string res_conv_8_conv = InternalUtils.decodeString(res_conv_8);
3030
res_conv_8_arr[i] = res_conv_8_conv;
3131
}

csharp_strings.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -581,7 +581,7 @@ def get_java_arr_elem(self, elem_ty, arr_name, idx):
581581
elif elem_ty.rust_obj == "LDKU5":
582582
return "InternalUtils.getU8ArrayElem(" + arr_name + ", " + idx + ")"
583583
elif elem_ty.rust_obj == "LDKStr":
584-
return "InternalUtils.getU32ArrayElem(" + arr_name + ", " + idx + ")"
584+
return "InternalUtils.getU64ArrayElem(" + arr_name + ", " + idx + ")"
585585
else:
586586
assert False
587587

0 commit comments

Comments
 (0)