X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Forg%2Fldk%2Fstructs%2FCommitmentUpdate.java;h=049a26c7407530de457a0493ab96860a3ae5a272;hb=b9716bc7ee492882e4643c9365971fef3761989f;hp=e59e98a9a41d0ab9bed0f7b342a475f1c3237113;hpb=ba1af51214a8ea2de62b84cd23b6145173c71752;p=ldk-java diff --git a/src/main/java/org/ldk/structs/CommitmentUpdate.java b/src/main/java/org/ldk/structs/CommitmentUpdate.java index e59e98a9..049a26c7 100644 --- a/src/main/java/org/ldk/structs/CommitmentUpdate.java +++ b/src/main/java/org/ldk/structs/CommitmentUpdate.java @@ -20,12 +20,42 @@ public class CommitmentUpdate extends CommonBase { if (ptr != 0) { bindings.CommitmentUpdate_free(ptr); } } + /** + * update_add_htlc messages which should be sent + */ + public UpdateAddHTLC[] get_update_add_htlcs() { + long[] ret = bindings.CommitmentUpdate_get_update_add_htlcs(this.ptr); + UpdateAddHTLC[] ret_conv_15_arr = new UpdateAddHTLC[ret.length]; + for (int p = 0; p < ret.length; p++) { + long ret_conv_15 = ret[p]; + UpdateAddHTLC ret_conv_15_hu_conv = new UpdateAddHTLC(null, ret_conv_15); + ret_conv_15_hu_conv.ptrs_to.add(this); + ret_conv_15_arr[p] = ret_conv_15_hu_conv; + } + return ret_conv_15_arr; + } + /** * update_add_htlc messages which should be sent */ public void set_update_add_htlcs(UpdateAddHTLC[] val) { bindings.CommitmentUpdate_set_update_add_htlcs(this.ptr, val != null ? Arrays.stream(val).mapToLong(val_conv_15 -> val_conv_15 == null ? 0 : val_conv_15.ptr & ~1).toArray() : null); - /* TODO 2 UpdateAddHTLC */; + for (UpdateAddHTLC val_conv_15: val) { this.ptrs_to.add(val_conv_15); }; + } + + /** + * update_fulfill_htlc messages which should be sent + */ + public UpdateFulfillHTLC[] get_update_fulfill_htlcs() { + long[] ret = bindings.CommitmentUpdate_get_update_fulfill_htlcs(this.ptr); + UpdateFulfillHTLC[] ret_conv_19_arr = new UpdateFulfillHTLC[ret.length]; + for (int t = 0; t < ret.length; t++) { + long ret_conv_19 = ret[t]; + UpdateFulfillHTLC ret_conv_19_hu_conv = new UpdateFulfillHTLC(null, ret_conv_19); + ret_conv_19_hu_conv.ptrs_to.add(this); + ret_conv_19_arr[t] = ret_conv_19_hu_conv; + } + return ret_conv_19_arr; } /** @@ -33,7 +63,22 @@ public class CommitmentUpdate extends CommonBase { */ public void set_update_fulfill_htlcs(UpdateFulfillHTLC[] val) { bindings.CommitmentUpdate_set_update_fulfill_htlcs(this.ptr, val != null ? Arrays.stream(val).mapToLong(val_conv_19 -> val_conv_19 == null ? 0 : val_conv_19.ptr & ~1).toArray() : null); - /* TODO 2 UpdateFulfillHTLC */; + for (UpdateFulfillHTLC val_conv_19: val) { this.ptrs_to.add(val_conv_19); }; + } + + /** + * update_fail_htlc messages which should be sent + */ + public UpdateFailHTLC[] get_update_fail_htlcs() { + long[] ret = bindings.CommitmentUpdate_get_update_fail_htlcs(this.ptr); + UpdateFailHTLC[] ret_conv_16_arr = new UpdateFailHTLC[ret.length]; + for (int q = 0; q < ret.length; q++) { + long ret_conv_16 = ret[q]; + UpdateFailHTLC ret_conv_16_hu_conv = new UpdateFailHTLC(null, ret_conv_16); + ret_conv_16_hu_conv.ptrs_to.add(this); + ret_conv_16_arr[q] = ret_conv_16_hu_conv; + } + return ret_conv_16_arr; } /** @@ -41,7 +86,22 @@ public class CommitmentUpdate extends CommonBase { */ public void set_update_fail_htlcs(UpdateFailHTLC[] val) { bindings.CommitmentUpdate_set_update_fail_htlcs(this.ptr, val != null ? Arrays.stream(val).mapToLong(val_conv_16 -> val_conv_16 == null ? 0 : val_conv_16.ptr & ~1).toArray() : null); - /* TODO 2 UpdateFailHTLC */; + for (UpdateFailHTLC val_conv_16: val) { this.ptrs_to.add(val_conv_16); }; + } + + /** + * update_fail_malformed_htlc messages which should be sent + */ + public UpdateFailMalformedHTLC[] get_update_fail_malformed_htlcs() { + long[] ret = bindings.CommitmentUpdate_get_update_fail_malformed_htlcs(this.ptr); + UpdateFailMalformedHTLC[] ret_conv_25_arr = new UpdateFailMalformedHTLC[ret.length]; + for (int z = 0; z < ret.length; z++) { + long ret_conv_25 = ret[z]; + UpdateFailMalformedHTLC ret_conv_25_hu_conv = new UpdateFailMalformedHTLC(null, ret_conv_25); + ret_conv_25_hu_conv.ptrs_to.add(this); + ret_conv_25_arr[z] = ret_conv_25_hu_conv; + } + return ret_conv_25_arr; } /** @@ -49,7 +109,7 @@ public class CommitmentUpdate extends CommonBase { */ public void set_update_fail_malformed_htlcs(UpdateFailMalformedHTLC[] val) { bindings.CommitmentUpdate_set_update_fail_malformed_htlcs(this.ptr, val != null ? Arrays.stream(val).mapToLong(val_conv_25 -> val_conv_25 == null ? 0 : val_conv_25.ptr & ~1).toArray() : null); - /* TODO 2 UpdateFailMalformedHTLC */; + for (UpdateFailMalformedHTLC val_conv_25: val) { this.ptrs_to.add(val_conv_25); }; } /** @@ -103,10 +163,10 @@ public class CommitmentUpdate extends CommonBase { if (ret < 1024) { return null; } CommitmentUpdate ret_hu_conv = new CommitmentUpdate(null, ret); ret_hu_conv.ptrs_to.add(ret_hu_conv); - /* TODO 2 UpdateAddHTLC */; - /* TODO 2 UpdateFulfillHTLC */; - /* TODO 2 UpdateFailHTLC */; - /* TODO 2 UpdateFailMalformedHTLC */; + for (UpdateAddHTLC update_add_htlcs_arg_conv_15: update_add_htlcs_arg) { ret_hu_conv.ptrs_to.add(update_add_htlcs_arg_conv_15); }; + for (UpdateFulfillHTLC update_fulfill_htlcs_arg_conv_19: update_fulfill_htlcs_arg) { ret_hu_conv.ptrs_to.add(update_fulfill_htlcs_arg_conv_19); }; + for (UpdateFailHTLC update_fail_htlcs_arg_conv_16: update_fail_htlcs_arg) { ret_hu_conv.ptrs_to.add(update_fail_htlcs_arg_conv_16); }; + for (UpdateFailMalformedHTLC update_fail_malformed_htlcs_arg_conv_25: update_fail_malformed_htlcs_arg) { ret_hu_conv.ptrs_to.add(update_fail_malformed_htlcs_arg_conv_25); }; ret_hu_conv.ptrs_to.add(update_fee_arg); ret_hu_conv.ptrs_to.add(commitment_signed_arg); return ret_hu_conv;