Skip to content

Commit

Permalink
Merge pull request #151 from aarani/fixStringArrayDecode
Browse files Browse the repository at this point in the history
CSharp: fix LDKStr array decoding
  • Loading branch information
TheBlueMatt committed Mar 13, 2024
2 parents cb6890a + dbcef74 commit 6ab8c07
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion c_sharp/src/org/ldk/structs/Bolt11Invoice.cs
Expand Up @@ -307,7 +307,7 @@ public class Bolt11Invoice : CommonBase {
int ret_conv_8_len = InternalUtils.getArrayLength(ret);
string[] ret_conv_8_arr = new string[ret_conv_8_len];
for (int i = 0; i < ret_conv_8_len; i++) {
long ret_conv_8 = InternalUtils.getU32ArrayElem(ret, i);
long ret_conv_8 = InternalUtils.getU64ArrayElem(ret, i);
string ret_conv_8_conv = InternalUtils.decodeString(ret_conv_8);
ret_conv_8_arr[i] = ret_conv_8_conv;
}
Expand Down
2 changes: 1 addition & 1 deletion c_sharp/src/org/ldk/structs/Result_CVec_StrZIOErrorZ.cs
Expand Up @@ -25,7 +25,7 @@ public class Result_CVec_StrZIOErrorZ_OK : Result_CVec_StrZIOErrorZ {
int res_conv_8_len = InternalUtils.getArrayLength(res);
string[] res_conv_8_arr = new string[res_conv_8_len];
for (int i = 0; i < res_conv_8_len; i++) {
long res_conv_8 = InternalUtils.getU32ArrayElem(res, i);
long res_conv_8 = InternalUtils.getU64ArrayElem(res, i);
string res_conv_8_conv = InternalUtils.decodeString(res_conv_8);
res_conv_8_arr[i] = res_conv_8_conv;
}
Expand Down
2 changes: 1 addition & 1 deletion csharp_strings.py
Expand Up @@ -581,7 +581,7 @@ def get_java_arr_elem(self, elem_ty, arr_name, idx):
elif elem_ty.rust_obj == "LDKU5":
return "InternalUtils.getU8ArrayElem(" + arr_name + ", " + idx + ")"
elif elem_ty.rust_obj == "LDKStr":
return "InternalUtils.getU32ArrayElem(" + arr_name + ", " + idx + ")"
return "InternalUtils.getU64ArrayElem(" + arr_name + ", " + idx + ")"
else:
assert False

Expand Down

0 comments on commit 6ab8c07

Please sign in to comment.