]> git.bitcoin.ninja Git - ldk-java/blob - src/main/java/org/ldk/structs/CommitmentUpdate.java
Fix race in tests
[ldk-java] / src / main / java / org / ldk / structs / CommitmentUpdate.java
1 package org.ldk.structs;
2
3 import org.ldk.impl.bindings;
4 import org.ldk.enums.*;
5 import org.ldk.util.*;
6 import java.util.Arrays;
7
8 @SuppressWarnings("unchecked") // We correctly assign various generic arrays
9 public class CommitmentUpdate extends CommonBase {
10         CommitmentUpdate(Object _dummy, long ptr) { super(ptr); }
11         @Override @SuppressWarnings("deprecation")
12         protected void finalize() throws Throwable {
13                 super.finalize();
14                 if (ptr != 0) { bindings.CommitmentUpdate_free(ptr); }
15         }
16
17         public static CommitmentUpdate constructor_clone(CommitmentUpdate orig) {
18                 long ret = bindings.CommitmentUpdate_clone(orig == null ? 0 : orig.ptr & ~1);
19                 CommitmentUpdate ret_hu_conv = new CommitmentUpdate(null, ret);
20                 ret_hu_conv.ptrs_to.add(orig);
21                 return ret_hu_conv;
22         }
23
24         public void set_update_add_htlcs(UpdateAddHTLC[] val) {
25                 bindings.CommitmentUpdate_set_update_add_htlcs(this.ptr, Arrays.stream(val).mapToLong(arr_conv_15 -> arr_conv_15 == null ? 0 : arr_conv_15.ptr & ~1).toArray());
26                 /* TODO 2 UpdateAddHTLC  */;
27         }
28
29         public void set_update_fulfill_htlcs(UpdateFulfillHTLC[] val) {
30                 bindings.CommitmentUpdate_set_update_fulfill_htlcs(this.ptr, Arrays.stream(val).mapToLong(arr_conv_19 -> arr_conv_19 == null ? 0 : arr_conv_19.ptr & ~1).toArray());
31                 /* TODO 2 UpdateFulfillHTLC  */;
32         }
33
34         public void set_update_fail_htlcs(UpdateFailHTLC[] val) {
35                 bindings.CommitmentUpdate_set_update_fail_htlcs(this.ptr, Arrays.stream(val).mapToLong(arr_conv_16 -> arr_conv_16 == null ? 0 : arr_conv_16.ptr & ~1).toArray());
36                 /* TODO 2 UpdateFailHTLC  */;
37         }
38
39         public void set_update_fail_malformed_htlcs(UpdateFailMalformedHTLC[] val) {
40                 bindings.CommitmentUpdate_set_update_fail_malformed_htlcs(this.ptr, Arrays.stream(val).mapToLong(arr_conv_25 -> arr_conv_25 == null ? 0 : arr_conv_25.ptr & ~1).toArray());
41                 /* TODO 2 UpdateFailMalformedHTLC  */;
42         }
43
44         public UpdateFee get_update_fee() {
45                 long ret = bindings.CommitmentUpdate_get_update_fee(this.ptr);
46                 UpdateFee ret_hu_conv = new UpdateFee(null, ret);
47                 return ret_hu_conv;
48         }
49
50         public void set_update_fee(UpdateFee val) {
51                 bindings.CommitmentUpdate_set_update_fee(this.ptr, val == null ? 0 : val.ptr & ~1);
52                 this.ptrs_to.add(val);
53         }
54
55         public CommitmentSigned get_commitment_signed() {
56                 long ret = bindings.CommitmentUpdate_get_commitment_signed(this.ptr);
57                 CommitmentSigned ret_hu_conv = new CommitmentSigned(null, ret);
58                 return ret_hu_conv;
59         }
60
61         public void set_commitment_signed(CommitmentSigned val) {
62                 bindings.CommitmentUpdate_set_commitment_signed(this.ptr, val == null ? 0 : val.ptr & ~1);
63                 this.ptrs_to.add(val);
64         }
65
66         public static CommitmentUpdate constructor_new(UpdateAddHTLC[] update_add_htlcs_arg, UpdateFulfillHTLC[] update_fulfill_htlcs_arg, UpdateFailHTLC[] update_fail_htlcs_arg, UpdateFailMalformedHTLC[] update_fail_malformed_htlcs_arg, UpdateFee update_fee_arg, CommitmentSigned commitment_signed_arg) {
67                 long ret = bindings.CommitmentUpdate_new(Arrays.stream(update_add_htlcs_arg).mapToLong(arr_conv_15 -> arr_conv_15 == null ? 0 : arr_conv_15.ptr & ~1).toArray(), Arrays.stream(update_fulfill_htlcs_arg).mapToLong(arr_conv_19 -> arr_conv_19 == null ? 0 : arr_conv_19.ptr & ~1).toArray(), Arrays.stream(update_fail_htlcs_arg).mapToLong(arr_conv_16 -> arr_conv_16 == null ? 0 : arr_conv_16.ptr & ~1).toArray(), Arrays.stream(update_fail_malformed_htlcs_arg).mapToLong(arr_conv_25 -> arr_conv_25 == null ? 0 : arr_conv_25.ptr & ~1).toArray(), update_fee_arg == null ? 0 : update_fee_arg.ptr & ~1, commitment_signed_arg == null ? 0 : commitment_signed_arg.ptr & ~1);
68                 CommitmentUpdate ret_hu_conv = new CommitmentUpdate(null, ret);
69                 /* TODO 2 UpdateAddHTLC  */;
70                 /* TODO 2 UpdateFulfillHTLC  */;
71                 /* TODO 2 UpdateFailHTLC  */;
72                 /* TODO 2 UpdateFailMalformedHTLC  */;
73                 ret_hu_conv.ptrs_to.add(update_fee_arg);
74                 ret_hu_conv.ptrs_to.add(commitment_signed_arg);
75                 return ret_hu_conv;
76         }
77
78 }