[C#] Update auto-generated C# bindings
[ldk-java] / c_sharp / src / org / ldk / structs / Ping.cs
index 9ca8849c6ee109eda4c2d47401cc18be09cd0ef5..cf5d834d8a2c721d5b750e9db0b3099d3866a6ad 100644 (file)
@@ -88,6 +88,18 @@ public class Ping : CommonBase {
                return ret_hu_conv;
        }
 
+       /**
+        * Generates a non-cryptographic 64-bit hash of the Ping.
+        */
+       public long hash() {
+               long ret = bindings.Ping_hash(this.ptr);
+               GC.KeepAlive(this);
+               return ret;
+       }
+
+       public override int GetHashCode() {
+               return (int)this.hash();
+       }
        /**
         * Checks if two Pings contain equal inner contents.
         * This ignores pointers and is_owned flags and looks at the values in fields.
@@ -109,16 +121,18 @@ public class Ping : CommonBase {
         * Serialize the Ping object into a byte array which can be read by Ping_read
         */
        public byte[] write() {
-               byte[] ret = bindings.Ping_write(this.ptr);
+               long ret = bindings.Ping_write(this.ptr);
                GC.KeepAlive(this);
-               return ret;
+               if (ret >= 0 && ret <= 4096) { return null; }
+               byte[] ret_conv = InternalUtils.decodeUint8Array(ret);
+               return ret_conv;
        }
 
        /**
         * Read a Ping from a byte array, created by Ping_write
         */
        public static Result_PingDecodeErrorZ read(byte[] ser) {
-               long ret = bindings.Ping_read(ser);
+               long ret = bindings.Ping_read(InternalUtils.encodeUint8Array(ser));
                GC.KeepAlive(ser);
                if (ret >= 0 && ret <= 4096) { return null; }
                Result_PingDecodeErrorZ ret_hu_conv = Result_PingDecodeErrorZ.constr_from_ptr(ret);