X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=ts%2Fstructs%2FResult_SecretKeyErrorZ.ts;h=ae21d631dd85a216b56f65e33619b213a93932b8;hb=f3e670e9341decac613d33fc52febf19cea32f20;hp=727c4b29810a2c9334f52a6efded7b7255a689ea;hpb=246459dcbc3be28c38b4951140a5933f4b3aa024;p=ldk-java diff --git a/ts/structs/Result_SecretKeyErrorZ.ts b/ts/structs/Result_SecretKeyErrorZ.ts index 727c4b29..ae21d631 100644 --- a/ts/structs/Result_SecretKeyErrorZ.ts +++ b/ts/structs/Result_SecretKeyErrorZ.ts @@ -9,7 +9,7 @@ public class Result_SecretKeyErrorZ extends CommonBase { } static Result_SecretKeyErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_SecretKeyErrorZ_result_ok(ptr)) { + if (bindings.CResult_SecretKeyErrorZ_is_ok(ptr)) { return new Result_SecretKeyErrorZ_OK(null, ptr); } else { return new Result_SecretKeyErrorZ_Err(null, ptr); @@ -21,19 +21,31 @@ public class Result_SecretKeyErrorZ extends CommonBase { super(_dummy, ptr); this.res = bindings.LDKCResult_SecretKeyErrorZ_get_ok(ptr); } - public Result_SecretKeyErrorZ_OK(Uint8Array res) { - this(null, bindings.CResult_SecretKeyErrorZ_ok(res)); - } } public static final class Result_SecretKeyErrorZ_Err extends Result_SecretKeyErrorZ { - public final LDKSecp256k1Error err; + public final Secp256k1Error err; private Result_SecretKeyErrorZ_Err(Object _dummy, long ptr) { super(_dummy, ptr); this.err = bindings.LDKCResult_SecretKeyErrorZ_get_err(ptr); } - public Result_SecretKeyErrorZ_Err(LDKSecp256k1Error err) { - this(null, bindings.CResult_SecretKeyErrorZ_err(err)); - } } + + public static Result_SecretKeyErrorZ constructor_ok(Uint8Array o) { + number ret = bindings.CResult_SecretKeyErrorZ_ok(InternalUtils.check_arr_len(o, 32)); + Result_SecretKeyErrorZ ret_hu_conv = Result_SecretKeyErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + public static Result_SecretKeyErrorZ constructor_err(Secp256k1Error e) { + number ret = bindings.CResult_SecretKeyErrorZ_err(e); + Result_SecretKeyErrorZ ret_hu_conv = Result_SecretKeyErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + public boolean is_ok() { + boolean ret = bindings.CResult_SecretKeyErrorZ_is_ok(this.ptr); + return ret; + } + }