[C#] Run tests against release library in determinism CI run
[ldk-java] / c_sharp / src / org / ldk / structs / TxRemoveInput.cs
1 using org.ldk.impl;
2 using org.ldk.enums;
3 using org.ldk.util;
4 using System;
5
6 namespace org { namespace ldk { namespace structs {
7
8
9 /**
10  * A tx_remove_input message for removing an input during interactive transaction construction.
11  */
12 public class TxRemoveInput : CommonBase {
13         internal TxRemoveInput(object _dummy, long ptr) : base(ptr) { }
14         ~TxRemoveInput() {
15                 if (ptr != 0) { bindings.TxRemoveInput_free(ptr); }
16         }
17
18         /**
19          * The channel ID
20          */
21         public ChannelId get_channel_id() {
22                 long ret = bindings.TxRemoveInput_get_channel_id(this.ptr);
23                 GC.KeepAlive(this);
24                 if (ret >= 0 && ret <= 4096) { return null; }
25                 org.ldk.structs.ChannelId ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelId(null, ret); }
26                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
27                 return ret_hu_conv;
28         }
29
30         /**
31          * The channel ID
32          */
33         public void set_channel_id(org.ldk.structs.ChannelId val) {
34                 bindings.TxRemoveInput_set_channel_id(this.ptr, val.ptr);
35                 GC.KeepAlive(this);
36                 GC.KeepAlive(val);
37                 if (this != null) { this.ptrs_to.AddLast(val); };
38         }
39
40         /**
41          * The serial ID of the input to be removed
42          */
43         public long get_serial_id() {
44                 long ret = bindings.TxRemoveInput_get_serial_id(this.ptr);
45                 GC.KeepAlive(this);
46                 return ret;
47         }
48
49         /**
50          * The serial ID of the input to be removed
51          */
52         public void set_serial_id(long val) {
53                 bindings.TxRemoveInput_set_serial_id(this.ptr, val);
54                 GC.KeepAlive(this);
55                 GC.KeepAlive(val);
56         }
57
58         /**
59          * Constructs a new TxRemoveInput given each field
60          */
61         public static TxRemoveInput of(org.ldk.structs.ChannelId channel_id_arg, long serial_id_arg) {
62                 long ret = bindings.TxRemoveInput_new(channel_id_arg.ptr, serial_id_arg);
63                 GC.KeepAlive(channel_id_arg);
64                 GC.KeepAlive(serial_id_arg);
65                 if (ret >= 0 && ret <= 4096) { return null; }
66                 org.ldk.structs.TxRemoveInput ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.TxRemoveInput(null, ret); }
67                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
68                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(channel_id_arg); };
69                 return ret_hu_conv;
70         }
71
72         internal long clone_ptr() {
73                 long ret = bindings.TxRemoveInput_clone_ptr(this.ptr);
74                 GC.KeepAlive(this);
75                 return ret;
76         }
77
78         /**
79          * Creates a copy of the TxRemoveInput
80          */
81         public TxRemoveInput clone() {
82                 long ret = bindings.TxRemoveInput_clone(this.ptr);
83                 GC.KeepAlive(this);
84                 if (ret >= 0 && ret <= 4096) { return null; }
85                 org.ldk.structs.TxRemoveInput ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.TxRemoveInput(null, ret); }
86                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
87                 return ret_hu_conv;
88         }
89
90         /**
91          * Generates a non-cryptographic 64-bit hash of the TxRemoveInput.
92          */
93         public long hash() {
94                 long ret = bindings.TxRemoveInput_hash(this.ptr);
95                 GC.KeepAlive(this);
96                 return ret;
97         }
98
99         public override int GetHashCode() {
100                 return (int)this.hash();
101         }
102         /**
103          * Checks if two TxRemoveInputs contain equal inner contents.
104          * This ignores pointers and is_owned flags and looks at the values in fields.
105          * Two objects with NULL inner values will be considered "equal" here.
106          */
107         public bool eq(org.ldk.structs.TxRemoveInput b) {
108                 bool ret = bindings.TxRemoveInput_eq(this.ptr, b.ptr);
109                 GC.KeepAlive(this);
110                 GC.KeepAlive(b);
111                 if (this != null) { this.ptrs_to.AddLast(b); };
112                 return ret;
113         }
114
115         public override bool Equals(object o) {
116                 if (!(o is TxRemoveInput)) return false;
117                 return this.eq((TxRemoveInput)o);
118         }
119         /**
120          * Serialize the TxRemoveInput object into a byte array which can be read by TxRemoveInput_read
121          */
122         public byte[] write() {
123                 long ret = bindings.TxRemoveInput_write(this.ptr);
124                 GC.KeepAlive(this);
125                 if (ret >= 0 && ret <= 4096) { return null; }
126                 byte[] ret_conv = InternalUtils.decodeUint8Array(ret);
127                 return ret_conv;
128         }
129
130         /**
131          * Read a TxRemoveInput from a byte array, created by TxRemoveInput_write
132          */
133         public static Result_TxRemoveInputDecodeErrorZ read(byte[] ser) {
134                 long ret = bindings.TxRemoveInput_read(InternalUtils.encodeUint8Array(ser));
135                 GC.KeepAlive(ser);
136                 if (ret >= 0 && ret <= 4096) { return null; }
137                 Result_TxRemoveInputDecodeErrorZ ret_hu_conv = Result_TxRemoveInputDecodeErrorZ.constr_from_ptr(ret);
138                 return ret_hu_conv;
139         }
140
141 }
142 } } }