Merge pull request #151 from aarani/fixStringArrayDecode
authorMatt Corallo <649246+TheBlueMatt@users.noreply.github.com>
Wed, 13 Mar 2024 14:54:04 +0000 (14:54 +0000)
committerGitHub <noreply@github.com>
Wed, 13 Mar 2024 14:54:04 +0000 (14:54 +0000)
CSharp: fix LDKStr array decoding

c_sharp/src/org/ldk/structs/Bolt11Invoice.cs
c_sharp/src/org/ldk/structs/Result_CVec_StrZIOErrorZ.cs
csharp_strings.py

index 81fbf4029160a29a15592939f2a25e6781909ebe..753798b9dbfe4a75e1e9126f370acde779ebd8c5 100644 (file)
@@ -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;
                }
index 05e96f7f7e688c2ffbbc3d297453366f88cb039d..7da2be506c871897f99cfa4b954b17984ed37d45 100644 (file)
@@ -25,7 +25,7 @@ public class Result_CVec_StrZIOErrorZ : CommonBase {
                        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;
                        }
index 1121f93413fc2975e1a398b9235d6f41d4dbb7f3..e1c2708e82e32ebcce0ea8dabe509c012675397a 100644 (file)
@@ -581,7 +581,7 @@ int CS_LDK_register_{fn_suffix}_invoker(invoker_{fn_suffix} invoker) {{
         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