2 import CommonBase from './CommonBase';
3 import * as bindings from '../bindings' // TODO: figure out location
5 public class Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ extends CommonBase {
6 private Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ(Object _dummy, long ptr) { super(ptr); }
7 protected void finalize() throws Throwable {
8 if (ptr != 0) { bindings.CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_free(ptr); } super.finalize();
11 static Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ constr_from_ptr(long ptr) {
12 if (bindings.LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_result_ok(ptr)) {
13 return new Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_OK(null, ptr);
15 return new Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_Err(null, ptr);
18 public static final class Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_OK extends Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ {
19 public final TwoTuple<byte[], ChannelManager> res;
20 private Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_OK(Object _dummy, long ptr) {
22 uint32_t res = bindings.LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_get_ok(ptr);
23 byte[] res_a = bindings.LDKC2Tuple_BlockHashChannelManagerZ_get_a(res);
24 uint32_t res_b = bindings.LDKC2Tuple_BlockHashChannelManagerZ_get_b(res);
25 ChannelManager res_b_hu_conv = new ChannelManager(null, res_b);;
26 TwoTuple<byte[], ChannelManager> res_conv = new TwoTuple<byte[], ChannelManager>(res_a, res_b_hu_conv);
29 public Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_OK(TwoTuple<byte[], ChannelManager> res) {
30 this(null, bindings.CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_ok(bindings.C2Tuple_BlockHashChannelManagerZ_new(res.a, res.b == null ? 0 : res.b.ptr & ~1/*XXX: this.ptrs_to.add(res_b)*/)));
34 public static final class Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_Err extends Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ {
35 public final DecodeError err;
36 private Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_Err(Object _dummy, long ptr) {
38 uint32_t err = bindings.LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_get_err(ptr);
39 DecodeError err_hu_conv = new DecodeError(null, err);
40 this.err = err_hu_conv;
42 public Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_Err(DecodeError err) {
43 this(null, bindings.CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1));
44 this.ptrs_to.add(err);