1 package org.ldk.structs;
3 import org.ldk.impl.bindings;
4 import org.ldk.enums.*;
6 import java.util.Arrays;
7 import javax.annotation.Nullable;
11 * An error occurring when converting from [`Script`] to [`ShutdownScript`].
13 @SuppressWarnings("unchecked") // We correctly assign various generic arrays
14 public class InvalidShutdownScript extends CommonBase {
15 InvalidShutdownScript(Object _dummy, long ptr) { super(ptr); }
16 @Override @SuppressWarnings("deprecation")
17 protected void finalize() throws Throwable {
19 if (ptr != 0) { bindings.InvalidShutdownScript_free(ptr); }
23 * The script that did not meet the requirements from [BOLT #2].
25 * [BOLT #2]: https://github.com/lightningnetwork/lightning-rfc/blob/master/02-peer-protocol.md
27 public byte[] get_script() {
28 byte[] ret = bindings.InvalidShutdownScript_get_script(this.ptr);
33 * The script that did not meet the requirements from [BOLT #2].
35 * [BOLT #2]: https://github.com/lightningnetwork/lightning-rfc/blob/master/02-peer-protocol.md
37 public void set_script(byte[] val) {
38 bindings.InvalidShutdownScript_set_script(this.ptr, val);
42 * Constructs a new InvalidShutdownScript given each field
44 public static InvalidShutdownScript of(byte[] script_arg) {
45 long ret = bindings.InvalidShutdownScript_new(script_arg);
46 if (ret < 1024) { return null; }
47 InvalidShutdownScript ret_hu_conv = new InvalidShutdownScript(null, ret);
48 ret_hu_conv.ptrs_to.add(ret_hu_conv);