[C#] Update auto-generated C# bindings
[ldk-java] / c_sharp / src / org / ldk / structs / LightningError.cs
index 4f5cc2260c5fa194fa8fc6d39076521547d9cabd..b06f312fb2f5f54df268f4f06f8fd431eb7f90ce 100644 (file)
@@ -19,16 +19,18 @@ public class LightningError : CommonBase {
         * A human-readable message describing the error
         */
        public string get_err() {
-               string ret = bindings.LightningError_get_err(this.ptr);
+               long ret = bindings.LightningError_get_err(this.ptr);
                GC.KeepAlive(this);
-               return ret;
+               if (ret >= 0 && ret <= 4096) { return null; }
+               string ret_conv = InternalUtils.decodeString(ret);
+               return ret_conv;
        }
 
        /**
         * A human-readable message describing the error
         */
        public void set_err(string val) {
-               bindings.LightningError_set_err(this.ptr, val);
+               bindings.LightningError_set_err(this.ptr, InternalUtils.encodeString(val));
                GC.KeepAlive(this);
                GC.KeepAlive(val);
        }
@@ -52,18 +54,20 @@ public class LightningError : CommonBase {
                bindings.LightningError_set_action(this.ptr, val.ptr);
                GC.KeepAlive(this);
                GC.KeepAlive(val);
+               if (this != null) { this.ptrs_to.AddLast(val); };
        }
 
        /**
         * Constructs a new LightningError given each field
         */
        public static LightningError of(string err_arg, org.ldk.structs.ErrorAction action_arg) {
-               long ret = bindings.LightningError_new(err_arg, action_arg.ptr);
+               long ret = bindings.LightningError_new(InternalUtils.encodeString(err_arg), action_arg.ptr);
                GC.KeepAlive(err_arg);
                GC.KeepAlive(action_arg);
                if (ret >= 0 && ret <= 4096) { return null; }
                org.ldk.structs.LightningError ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.LightningError(null, ret); }
                if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
+               if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(action_arg); };
                return ret_hu_conv;
        }