Update auto-generated bindings
[ldk-java] / src / main / java / org / ldk / structs / DataLossProtect.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
9 /**
10  * Proof that the sender knows the per-commitment secret of the previous commitment transaction.
11  * This is used to convince the recipient that the channel is at a certain commitment
12  * number even if they lost that data due to a local failure.  Of course, the peer may lie
13  * and even later commitments may have been revoked.
14  */
15 @SuppressWarnings("unchecked") // We correctly assign various generic arrays
16 public class DataLossProtect extends CommonBase {
17         DataLossProtect(Object _dummy, long ptr) { super(ptr); }
18         @Override @SuppressWarnings("deprecation")
19         protected void finalize() throws Throwable {
20                 super.finalize();
21                 if (ptr != 0) { bindings.DataLossProtect_free(ptr); }
22         }
23
24         /**
25          * Proof that the sender knows the per-commitment secret of a specific commitment transaction
26          * belonging to the recipient
27          */
28         public byte[] get_your_last_per_commitment_secret() {
29                 byte[] ret = bindings.DataLossProtect_get_your_last_per_commitment_secret(this.ptr);
30                 return ret;
31         }
32
33         /**
34          * Proof that the sender knows the per-commitment secret of a specific commitment transaction
35          * belonging to the recipient
36          */
37         public void set_your_last_per_commitment_secret(byte[] val) {
38                 bindings.DataLossProtect_set_your_last_per_commitment_secret(this.ptr, val);
39         }
40
41         /**
42          * The sender's per-commitment point for their current commitment transaction
43          */
44         public byte[] get_my_current_per_commitment_point() {
45                 byte[] ret = bindings.DataLossProtect_get_my_current_per_commitment_point(this.ptr);
46                 return ret;
47         }
48
49         /**
50          * The sender's per-commitment point for their current commitment transaction
51          */
52         public void set_my_current_per_commitment_point(byte[] val) {
53                 bindings.DataLossProtect_set_my_current_per_commitment_point(this.ptr, val);
54         }
55
56         /**
57          * Constructs a new DataLossProtect given each field
58          */
59         public static DataLossProtect of(byte[] your_last_per_commitment_secret_arg, byte[] my_current_per_commitment_point_arg) {
60                 long ret = bindings.DataLossProtect_new(your_last_per_commitment_secret_arg, my_current_per_commitment_point_arg);
61                 DataLossProtect ret_hu_conv = new DataLossProtect(null, ret);
62                 ret_hu_conv.ptrs_to.add(ret_hu_conv);
63                 return ret_hu_conv;
64         }
65
66         /**
67          * Creates a copy of the DataLossProtect
68          */
69         public DataLossProtect clone() {
70                 long ret = bindings.DataLossProtect_clone(this.ptr);
71                 DataLossProtect ret_hu_conv = new DataLossProtect(null, ret);
72                 ret_hu_conv.ptrs_to.add(this);
73                 return ret_hu_conv;
74         }
75
76 }