[Java] Print error stack trace when tests fail
[ldk-java] / c_sharp / src / org / ldk / structs / TxAckRbf.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_ack_rbf message which acknowledges replacement of the transaction after it's been
11  * completed.
12  */
13 public class TxAckRbf : CommonBase {
14         internal TxAckRbf(object _dummy, long ptr) : base(ptr) { }
15         ~TxAckRbf() {
16                 if (ptr != 0) { bindings.TxAckRbf_free(ptr); }
17         }
18
19         /**
20          * The channel ID
21          */
22         public ChannelId get_channel_id() {
23                 long ret = bindings.TxAckRbf_get_channel_id(this.ptr);
24                 GC.KeepAlive(this);
25                 if (ret >= 0 && ret <= 4096) { return null; }
26                 org.ldk.structs.ChannelId ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelId(null, ret); }
27                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
28                 return ret_hu_conv;
29         }
30
31         /**
32          * The channel ID
33          */
34         public void set_channel_id(org.ldk.structs.ChannelId val) {
35                 bindings.TxAckRbf_set_channel_id(this.ptr, val.ptr);
36                 GC.KeepAlive(this);
37                 GC.KeepAlive(val);
38                 if (this != null) { this.ptrs_to.AddLast(val); };
39         }
40
41         /**
42          * The number of satoshis the sender will contribute to or, if negative, remove from
43          * (e.g. splice-out) the funding output of the transaction
44          */
45         public Option_i64Z get_funding_output_contribution() {
46                 long ret = bindings.TxAckRbf_get_funding_output_contribution(this.ptr);
47                 GC.KeepAlive(this);
48                 if (ret >= 0 && ret <= 4096) { return null; }
49                 org.ldk.structs.Option_i64Z ret_hu_conv = org.ldk.structs.Option_i64Z.constr_from_ptr(ret);
50                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
51                 return ret_hu_conv;
52         }
53
54         /**
55          * The number of satoshis the sender will contribute to or, if negative, remove from
56          * (e.g. splice-out) the funding output of the transaction
57          */
58         public void set_funding_output_contribution(org.ldk.structs.Option_i64Z val) {
59                 bindings.TxAckRbf_set_funding_output_contribution(this.ptr, val.ptr);
60                 GC.KeepAlive(this);
61                 GC.KeepAlive(val);
62                 if (this != null) { this.ptrs_to.AddLast(val); };
63         }
64
65         /**
66          * Constructs a new TxAckRbf given each field
67          */
68         public static TxAckRbf of(org.ldk.structs.ChannelId channel_id_arg, org.ldk.structs.Option_i64Z funding_output_contribution_arg) {
69                 long ret = bindings.TxAckRbf_new(channel_id_arg.ptr, funding_output_contribution_arg.ptr);
70                 GC.KeepAlive(channel_id_arg);
71                 GC.KeepAlive(funding_output_contribution_arg);
72                 if (ret >= 0 && ret <= 4096) { return null; }
73                 org.ldk.structs.TxAckRbf ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.TxAckRbf(null, ret); }
74                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
75                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(channel_id_arg); };
76                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(funding_output_contribution_arg); };
77                 return ret_hu_conv;
78         }
79
80         internal long clone_ptr() {
81                 long ret = bindings.TxAckRbf_clone_ptr(this.ptr);
82                 GC.KeepAlive(this);
83                 return ret;
84         }
85
86         /**
87          * Creates a copy of the TxAckRbf
88          */
89         public TxAckRbf clone() {
90                 long ret = bindings.TxAckRbf_clone(this.ptr);
91                 GC.KeepAlive(this);
92                 if (ret >= 0 && ret <= 4096) { return null; }
93                 org.ldk.structs.TxAckRbf ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.TxAckRbf(null, ret); }
94                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
95                 return ret_hu_conv;
96         }
97
98         /**
99          * Generates a non-cryptographic 64-bit hash of the TxAckRbf.
100          */
101         public long hash() {
102                 long ret = bindings.TxAckRbf_hash(this.ptr);
103                 GC.KeepAlive(this);
104                 return ret;
105         }
106
107         public override int GetHashCode() {
108                 return (int)this.hash();
109         }
110         /**
111          * Checks if two TxAckRbfs contain equal inner contents.
112          * This ignores pointers and is_owned flags and looks at the values in fields.
113          * Two objects with NULL inner values will be considered "equal" here.
114          */
115         public bool eq(org.ldk.structs.TxAckRbf b) {
116                 bool ret = bindings.TxAckRbf_eq(this.ptr, b.ptr);
117                 GC.KeepAlive(this);
118                 GC.KeepAlive(b);
119                 if (this != null) { this.ptrs_to.AddLast(b); };
120                 return ret;
121         }
122
123         public override bool Equals(object o) {
124                 if (!(o is TxAckRbf)) return false;
125                 return this.eq((TxAckRbf)o);
126         }
127         /**
128          * Serialize the TxAckRbf object into a byte array which can be read by TxAckRbf_read
129          */
130         public byte[] write() {
131                 long ret = bindings.TxAckRbf_write(this.ptr);
132                 GC.KeepAlive(this);
133                 if (ret >= 0 && ret <= 4096) { return null; }
134                 byte[] ret_conv = InternalUtils.decodeUint8Array(ret);
135                 return ret_conv;
136         }
137
138         /**
139          * Read a TxAckRbf from a byte array, created by TxAckRbf_write
140          */
141         public static Result_TxAckRbfDecodeErrorZ read(byte[] ser) {
142                 long ret = bindings.TxAckRbf_read(InternalUtils.encodeUint8Array(ser));
143                 GC.KeepAlive(ser);
144                 if (ret >= 0 && ret <= 4096) { return null; }
145                 Result_TxAckRbfDecodeErrorZ ret_hu_conv = Result_TxAckRbfDecodeErrorZ.constr_from_ptr(ret);
146                 return ret_hu_conv;
147         }
148
149 }
150 } } }